home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / TEECHART / Src Code / OPENGL2.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-10-24  |  164.9 KB  |  3,403 lines

  1. unit OpenGL2;
  2.  
  3. //------------------------------------------------------------------------------
  4. //
  5. //  Extended translation of the OpenGL header files (version 1.1) for Delphi 2.0+
  6. //
  7. //------------------------------------------------------------------------------
  8. //
  9. //  This is a maintained interface unit for the use of OpenGL with Delphi and contains
  10. //  the translations for gl.h, glu.h and support functions prepared for the use
  11. //  of the SGI & Microsoft OpenGL DLLs. This unit contains bug fixes and enhancements
  12. //  of Borland's and other translations as well as support for extensions.
  13. //
  14. //------------------------------------------------------------------------------
  15. //
  16. //  Usage: Simply take this unit in the uses clause of your project files, which
  17. //         need to call OpenGL. In addition, you could compile this unit and replace
  18. //         the original .dcu file (D3 only) in the lib folder of your Delphi installation.
  19. //         If you want to make a backup before, do so, but you won't need that. This
  20. //         unit has been tested with all Delphi versions from 2.0 upward and works
  21. //         very well.
  22. //         Since the DLLs OpenGL(32) and GLU(32) are linked dynamically with this unit
  23. //         you have to initialize it by calling InitOpenGL or InitOpenGLFromLibrary from
  24. //         anywhere in your project. The release of the DLLs happens automatically.
  25. //         This kind of linkage provides a better means to control what's in memory
  26. //         and prevents program crashes when the needed DLLs aren't available.
  27. //         NOTE: If you're going to use the SGI OpenGL DLLs you must ensure a specific
  28. //               order of Windows.pas and OpenGL.pas. This is a known problem with
  29. //               these DLLs and not a bug in this unit. The function which is concerned
  30. //               is SetPixelFormat. So always place Windows.pas in the uses clause
  31. //               of those units, which also use OpenGL (even if you don't need
  32. //               Windows.pas) and place it BEFORE OpenGL.pas! Since there are more
  33. //               conflicts between Windows.pas and other units (e.g. Windows.TBitmap
  34. //               and Graphics.TBitmap), you should always place Windows.pas at the
  35. //               very first place in your uses clauses.
  36. //
  37. //         For your convenience I put some support routines in this unit, which are
  38. //         NOT part of the standard header files (gl.h and glu.h). For my convenience
  39. //         I've put the description of the other funtions also in the following list:
  40. //
  41. // function InitOpenGL: Boolean;
  42. //   Needed to load the OpenGL DLLs and all addresses of the standard functions.
  43. //   It first tries to load the SGI DLLs, since most of you won't have HW acceleration
  44. //   and these DLLs are faster without HW accel. than the MS DLLs. If loading of
  45. //   the SGI DLLs failed for some reason, the MS versions are used. If HW accel. is
  46. //   available then the SGI DLL automatically link to the MS DLLs, which are able
  47. //   to use this feature.
  48. //   In case OpenGL is already initialized, this function does nothing. No error
  49. //   is raised, if something goes wrong, but you need to inspect the result in order
  50. //   to know whether all went okay.
  51. //   RESULT: True if successful or already loaded, false otherwise
  52. //
  53. // function InitOpenGLFromLibrary(GL_Name, GLU_Name: String): Boolean;
  54. //   Same as InitOpenGL, but you can specify specific DLLs. Great if you want to
  55. //   use totally different DLLs. This function closes eventually loaded DLLs
  56. //   before it tries to open the newly given.
  57. //   RESULT: True if successful, false otherwise
  58. //
  59. // procedure CloseOpenGL;
  60. //   Unloads the OpenGL DLLs and sets all routine addresses to nil, including
  61. //   extensions. You can load and unload the DLLs as often as you like.
  62. //
  63. // procedure ClearExtensions;
  64. //   Sets all extension routines to nil. This is needed when you change the Pixelformat
  65. //   of your OpenGL window, since the availability of these routines changes from
  66. //   PixelFormat to Pixelformat (and also from SGI to MS DLLs).
  67. //
  68. // function CreateRenderingContext(DC: HDC; Options: TRCOptions; ColorDepth: Integer; StencilBits: Byte): HGLRC;
  69. //   Sets up a pixel format and creates a new rendering context depending of the
  70. //   given parameters:
  71. //     DC          - the device context, for which the rc is to be created
  72. //     Options     - special options for the context, they correspond to the flags
  73. //                   of the PIXELFORMATDESCRIPTOR
  74. //     ColorDepth  - the actual color depth you want, this is only useful for bitmap contexts
  75. //     StencilBits - determines the size of the stencil buffer
  76. //   RESULT: the newly created context or 0 if setup faild
  77. //
  78. // procedure ActivateRenderingContext(DC: HDC; RC: HGLRC);
  79. //   Makes RC in DC 'current' (wglMakeCurrent(..)) and loads all extension addresses
  80. //   and flags if necessary.
  81. //
  82. // procedure DeactivateRenderingContext;
  83. //   Counterpart to ActivateRenderingContext.
  84. //
  85. // procedure DestroyRenderingContext(RC: HGLRC);
  86. //   RC will be destroyed and must be recreated if you want to use it again. No
  87. //   additional functionality to wglDeleteContext yet.
  88. //
  89. // procedure ReadExtensions;
  90. //   Determines which extensions for the current rendering context are available
  91. //   loads their addresses. This procedure is called from ActivateRenderingContext
  92. //   if a new pixel format is used, but you can safely call it from where you want
  93. //   to actualize those values (under the condition that a rendering context MUST be
  94. //   active).
  95. //
  96. // procedure ReadImplementationProperties;
  97. //   Determines global properties of the OpenGL DLL (currently the versions only)
  98. //   and needs to be used only once. It is called from CreateRenderingContext, when
  99. //   it is the very first call to this function (after loading the DLLs).
  100. //
  101. //------------------------------------------------------------------------------
  102. //
  103. // This translation is based on different sources:
  104. //
  105. // - first translation from Artemis Alliance Inc.
  106. // - previous versions from Mike Lischke
  107. // - Alexander Staubo
  108. // - Borland OpenGL.pas (from Delphi3)
  109. // - Microsoft and SGI OpenGL header files
  110. // - www.opengl.org, www.sgi.com/OpenGL
  111. //
  112. //  Contact:  Lischke@imib.med.tu-dresden.de
  113. //
  114. //  last change : 05. December 1997
  115. //
  116. //------------------------------------------------------------------------------
  117.  
  118.  
  119. { ------ Original copyright notice by SGI -----
  120.  
  121.  Copyright 1996 Silicon Graphics, Inc.
  122.  All Rights Reserved.
  123.  
  124.  This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  125.  the contents of this file may not be disclosed to third parties, copied or
  126.  duplicated in any form, in whole or in part, without the prior written
  127.  permission of Silicon Graphics, Inc.
  128.  
  129.  RESTRICTED RIGHTS LEGEND:
  130.  Use, duplication or disclosure by the Government is subject to restrictions
  131.  as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  132.  and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  133.  successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  134.  rights reserved under the Copyright Laws of the United States.}
  135.  
  136.  
  137. interface
  138.  
  139. uses Windows, Geometry;
  140.  
  141. type TRCOptions = set of (opDoubleBuffered,opGDI,opStereo);
  142.  
  143.      GLenum      = UINT;      PGLenum     = ^GLenum;
  144.      GLboolean   = UCHAR;     PGLboolean  = ^GLboolean;
  145.      GLbitfield  = UINT;      PGLbitfield = ^GLbitfield;
  146.      GLbyte      = ShortInt;  PGLbyte     = ^GLbyte;
  147.      GLshort     = SHORT;     PGLshort    = ^GLshort;
  148.      GLint       = Integer;   PGLint      = ^GLint;
  149.      GLsizei     = Integer;   PGLsizei    = ^GLsizei;
  150.      GLubyte     = UCHAR;     PGLubyte    = ^GLubyte;
  151.      GLushort    = Word;      PGLushort   = ^GLushort;
  152.      GLuint      = UINT;      PGLuint     = ^GLuint;
  153.      GLfloat     = Single;    PGLfloat    = ^GLfloat;
  154.      GLclampf    = Single;    PGLclampf   = ^GLclampf;
  155.      GLdouble    = Double;    PGLdouble   = ^GLdouble;
  156.      GLclampd    = Double;    PGLclampd   = ^GLclampd;
  157.  
  158. //------------------------------------------------------------------------------
  159.  
  160. var GL_VERSION_1_0,
  161.     GL_VERSION_1_1,
  162.     GL_VERSION_1_2,
  163.     GLU_VERSION_1_1,
  164.     GLU_VERSION_1_2 : Boolean;
  165.  
  166.     // Extensions (gl)
  167.     GL_EXT_abgr,
  168.     GL_EXT_bgra,
  169.     GL_EXT_packed_pixels,
  170.     GL_EXT_paletted_texture,
  171.     GL_EXT_vertex_array,
  172.     GL_SGI_compiled_vertex_array,
  173.     GL_SGI_cull_vertex,
  174.     GL_SGI_index_array_formats,
  175.     GL_SGI_index_func,
  176.     GL_SGI_index_material,
  177.     GL_SGI_index_texture,
  178.     GL_WIN_swap_hint,
  179.     GL_EXT_blend_color,
  180.     GL_EXT_blend_logic_op,
  181.     GL_EXT_blend_minmax,
  182.     GL_EXT_blend_subtract,
  183.     GL_EXT_convolution,
  184.     GL_EXT_copy_texture,
  185.     GL_EXT_histogram,
  186.     GL_EXT_polygon_offset,
  187.     GL_EXT_subtexture,
  188.     GL_EXT_texture,
  189.     GL_EXT_texture_object,
  190.     GL_EXT_texture3D,
  191.     GL_EXT_cmyka,
  192.     GL_EXT_rescale_normal,
  193.     GL_SGI_color_matrix,
  194.     GL_SGI_texture_color_table,
  195.     GL_SGI_color_table,
  196.     GL_EXT_clip_volume_hint,
  197.     GL_EXT_misc_attribute,
  198.     GL_EXT_scene_marker,
  199.     GL_EXT_shared_texture_palette,
  200.  
  201.     // Extensions (glu)
  202.     GLU_EXT_TEXTURE,
  203.     GLU_EXT_object_space_tess,
  204.     GLU_EXT_nurbs_tessellator     : Boolean;
  205.  
  206. //------------------------------------------------------------------------------
  207.  
  208. const // ********** GL generic constants **********
  209.  
  210.       // AttribMask
  211.       GL_CURRENT_BIT                     = $00000001;
  212.       GL_POINT_BIT                       = $00000002;
  213.       GL_LINE_BIT                        = $00000004;
  214.       GL_POLYGON_BIT                     = $00000008;
  215.       GL_POLYGON_STIPPLE_BIT             = $00000010;
  216.       GL_PIXEL_MODE_BIT                  = $00000020;
  217.       GL_LIGHTING_BIT                    = $00000040;
  218.       GL_FOG_BIT                         = $00000080;
  219.       GL_DEPTH_BUFFER_BIT                = $00000100;
  220.       GL_ACCUM_BUFFER_BIT                = $00000200;
  221.       GL_STENCIL_BUFFER_BIT              = $00000400;
  222.       GL_VIEWPORT_BIT                    = $00000800;
  223.       GL_TRANSFORM_BIT                   = $00001000;
  224.       GL_ENABLE_BIT                      = $00002000;
  225.       GL_COLOR_BUFFER_BIT                = $00004000;
  226.       GL_HINT_BIT                        = $00008000;
  227.       GL_EVAL_BIT                        = $00010000;
  228.       GL_LIST_BIT                        = $00020000;
  229.       GL_TEXTURE_BIT                     = $00040000;
  230.       GL_SCISSOR_BIT                     = $00080000;
  231.       GL_ALL_ATTRIB_BITS                 = $000FFFFF;
  232.  
  233.       // ClientAttribMask
  234.       GL_CLIENT_PIXEL_STORE_BIT          = $00000001;
  235.       GL_CLIENT_VERTEX_ARRAY_BIT         = $00000002;
  236.       GL_CLIENT_ALL_ATTRIB_BITS          = $FFFFFFFF;
  237.  
  238.       // Boolean
  239.       GL_FALSE                           = 0;
  240.       GL_TRUE                            = 1;
  241.  
  242.       // BeginMode
  243.       GL_POINTS                          = $0000;
  244.       GL_LINES                           = $0001;
  245.       GL_LINE_LOOP                       = $0002;
  246.       GL_LINE_STRIP                      = $0003;
  247.       GL_TRIANGLES                       = $0004;
  248.       GL_TRIANGLE_STRIP                  = $0005;
  249.       GL_TRIANGLE_FAN                    = $0006;
  250.       GL_QUADS                           = $0007;
  251.       GL_QUAD_STRIP                      = $0008;
  252.       GL_POLYGON                         = $0009;
  253.  
  254.       // AccumOp
  255.       GL_ACCUM                           = $0100;
  256.       GL_LOAD                            = $0101;
  257.       GL_RETURN                          = $0102;
  258.       GL_MULT                            = $0103;
  259.       GL_ADD                             = $0104;
  260.  
  261.       // AlphaFunction
  262.       GL_NEVER                           = $0200;
  263.       GL_LESS                            = $0201;
  264.       GL_EQUAL                           = $0202;
  265.       GL_LEQUAL                          = $0203;
  266.       GL_GREATER                         = $0204;
  267.       GL_NOTEQUAL                        = $0205;
  268.       GL_GEQUAL                          = $0206;
  269.       GL_ALWAYS                          = $0207;
  270.  
  271.       // BlendingFactorDest
  272.       GL_ZERO                            = 0;
  273.       GL_ONE                             = 1;
  274.       GL_SRC_COLOR                       = $0300;
  275.       GL_ONE_MINUS_SRC_COLOR             = $0301;
  276.       GL_SRC_ALPHA                       = $0302;
  277.       GL_ONE_MINUS_SRC_ALPHA             = $0303;
  278.       GL_DST_ALPHA                       = $0304;
  279.       GL_ONE_MINUS_DST_ALPHA             = $0305;
  280.  
  281.       // BlendingFactorSrc
  282.       GL_DST_COLOR                       = $0306;
  283.       GL_ONE_MINUS_DST_COLOR             = $0307;
  284.       GL_SRC_ALPHA_SATURATE              = $0308;
  285.  
  286.       // BlendingFactor (Src and Dest) GL 1.2 ARB imaging
  287.       GL_CONSTANT_COLOR                  = $8001;
  288.       GL_ONE_MINUS_CONSTANT_COLOR        = $8002;
  289.       GL_CONSTANT_ALPHA                  = $8003;
  290.       GL_ONE_MINUS_CONSTANT_ALPHA        = $8004;
  291.  
  292.       // BlendEquation GL 1.2 ARB imaging
  293.       GL_FUNC_ADD                        = $8006;
  294.       GL_MIN                             = $8007;
  295.       GL_MAX                             = $8008;
  296.       GL_FUNC_SUBTRACT                   = $800A;
  297.       GL_FUNC_REVERSE_SUBTRACT           = $800B;
  298.  
  299.       // color table GL 1.2 ARB imaging
  300.       GL_COLOR_TABLE                     = $80D0;
  301.       GL_POST_CONVOLUTION_COLOR_TABLE    = $80D1;
  302.       GL_POST_COLOR_MATRIX_COLOR_TABLE   = $80D2;
  303.       GL_PROXY_COLOR_TABLE               = $80D3;
  304.       GL_PROXY_POST_CONVOLUTION_COLOR_TABLE = $80D4;
  305.       GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE = $80D5;
  306.       GL_COLOR_TABLE_SCALE               = $80D6;
  307.       GL_COLOR_TABLE_BIAS                = $80D7;
  308.       GL_COLOR_TABLE_FORMAT              = $80D8;
  309.       GL_COLOR_TABLE_WIDTH               = $80D9;
  310.       GL_COLOR_TABLE_RED_SIZE            = $80DA;
  311.       GL_COLOR_TABLE_GREEN_SIZE          = $80DB;
  312.       GL_COLOR_TABLE_BLUE_SIZE           = $80DC;
  313.       GL_COLOR_TABLE_ALPHA_SIZE          = $80DD;
  314.       GL_COLOR_TABLE_LUMINANCE_SIZE      = $80DE;
  315.       GL_COLOR_TABLE_INTENSITY_SIZE      = $80DF;
  316.  
  317.       // convolutions GL 1.2 ARB imaging
  318.       GL_CONVOLUTION_1D                  = $8010;
  319.       GL_CONVOLUTION_2D                  = $8011;
  320.       GL_SEPARABLE_2D                    = $8012;
  321.       GL_CONVOLUTION_BORDER_MODE         = $8013;
  322.       GL_CONVOLUTION_FILTER_SCALE        = $8014;
  323.       GL_CONVOLUTION_FILTER_BIAS         = $8015;
  324.       GL_REDUCE                          = $8016;
  325.       GL_CONVOLUTION_FORMAT              = $8017;
  326.       GL_CONVOLUTION_WIDTH               = $8018;
  327.       GL_CONVOLUTION_HEIGHT              = $8019;
  328.       GL_MAX_CONVOLUTION_WIDTH           = $801A;
  329.       GL_MAX_CONVOLUTION_HEIGHT          = $801B;
  330.       GL_POST_CONVOLUTION_RED_SCALE      = $801C;
  331.       GL_POST_CONVOLUTION_GREEN_SCALE    = $801D;
  332.       GL_POST_CONVOLUTION_BLUE_SCALE     = $801E;
  333.       GL_POST_CONVOLUTION_ALPHA_SCALE    = $801F;
  334.       GL_POST_CONVOLUTION_RED_BIAS       = $8020;
  335.       GL_POST_CONVOLUTION_GREEN_BIAS     = $8021;
  336.       GL_POST_CONVOLUTION_BLUE_BIAS      = $8022;
  337.       GL_POST_CONVOLUTION_ALPHA_BIAS     = $8023;
  338.  
  339.       // histogram GL 1.2 ARB imaging
  340.       GL_HISTOGRAM                       = $8024;
  341.       GL_PROXY_HISTOGRAM                 = $8025;
  342.       GL_HISTOGRAM_WIDTH                 = $8026;
  343.       GL_HISTOGRAM_FORMAT                = $8027;
  344.       GL_HISTOGRAM_RED_SIZE              = $8028;
  345.       GL_HISTOGRAM_GREEN_SIZE            = $8029;
  346.       GL_HISTOGRAM_BLUE_SIZE             = $802A;
  347.       GL_HISTOGRAM_ALPHA_SIZE            = $802B;
  348.       GL_HISTOGRAM_LUMINANCE_SIZE        = $802C;
  349.       GL_HISTOGRAM_SINK                  = $802D;
  350.       GL_MINMAX                          = $802E;
  351.       GL_MINMAX_FORMAT                   = $802F;
  352.       GL_MINMAX_SINK                     = $8030;
  353.  
  354.       // DrawBufferMode
  355.       GL_NONE                            = 0;
  356.       GL_FRONT_LEFT                      = $0400;
  357.       GL_FRONT_RIGHT                     = $0401;
  358.       GL_BACK_LEFT                       = $0402;
  359.       GL_BACK_RIGHT                      = $0403;
  360.       GL_FRONT                           = $0404;
  361.       GL_BACK                            = $0405;
  362.       GL_LEFT                            = $0406;
  363.       GL_RIGHT                           = $0407;
  364.       GL_FRONT_AND_BACK                  = $0408;
  365.       GL_AUX0                            = $0409;
  366.       GL_AUX1                            = $040A;
  367.       GL_AUX2                            = $040B;
  368.       GL_AUX3                            = $040C;
  369.  
  370.       // ErrorCode
  371.       GL_NO_ERROR                        = 0;
  372.       GL_INVALID_ENUM                    = $0500;
  373.       GL_INVALID_VALUE                   = $0501;
  374.       GL_INVALID_OPERATION               = $0502;
  375.       GL_STACK_OVERFLOW                  = $0503;
  376.       GL_STACK_UNDERFLOW                 = $0504;
  377.       GL_OUT_OF_MEMORY                   = $0505;
  378.  
  379.       // FeedbackType
  380.       GL_2D                              = $0600;
  381.       GL_3D                              = $0601;
  382.       GL_3D_COLOR                        = $0602;
  383.       GL_3D_COLOR_TEXTURE                = $0603;
  384.       GL_4D_COLOR_TEXTURE                = $0604;
  385.  
  386.       // FeedBackToken
  387.       GL_PASS_THROUGH_TOKEN              = $0700;
  388.       GL_POINT_TOKEN                     = $0701;
  389.       GL_LINE_TOKEN                      = $0702;
  390.       GL_POLYGON_TOKEN                   = $0703;
  391.       GL_BITMAP_TOKEN                    = $0704;
  392.       GL_DRAW_PIXEL_TOKEN                = $0705;
  393.       GL_COPY_PIXEL_TOKEN                = $0706;
  394.       GL_LINE_RESET_TOKEN                = $0707;
  395.  
  396.       // FogMode
  397.       GL_EXP                             = $0800;
  398.       GL_EXP2                            = $0801;
  399.  
  400.       // FrontFaceDirection
  401.       GL_CW                              = $0900;
  402.       GL_CCW                             = $0901;
  403.  
  404.       // GetMapQuery
  405.       GL_COEFF                           = $0A00;
  406.       GL_ORDER                           = $0A01;
  407.       GL_DOMAIN                          = $0A02;
  408.  
  409.       // GetPixelMap
  410.       GL_PIXEL_MAP_I_TO_I                = $0C70;
  411.       GL_PIXEL_MAP_S_TO_S                = $0C71;
  412.       GL_PIXEL_MAP_I_TO_R                = $0C72;
  413.       GL_PIXEL_MAP_I_TO_G                = $0C73;
  414.       GL_PIXEL_MAP_I_TO_B                = $0C74;
  415.       GL_PIXEL_MAP_I_TO_A                = $0C75;
  416.       GL_PIXEL_MAP_R_TO_R                = $0C76;
  417.       GL_PIXEL_MAP_G_TO_G                = $0C77;
  418.       GL_PIXEL_MAP_B_TO_B                = $0C78;
  419.       GL_PIXEL_MAP_A_TO_A                = $0C79;
  420.  
  421.       // GetPointervPName
  422.       GL_VERTEX_ARRAY_POINTER            = $808E;
  423.       GL_NORMAL_ARRAY_POINTER            = $808F;
  424.       GL_COLOR_ARRAY_POINTER             = $8090;
  425.       GL_INDEX_ARRAY_POINTER             = $8091;
  426.       GL_TEXTURE_COORD_ARRAY_POINTER     = $8092;
  427.       GL_EDGE_FLAG_ARRAY_POINTER         = $8093;
  428.  
  429.       // GetPName
  430.       GL_CURRENT_COLOR                   = $0B00;
  431.       GL_CURRENT_INDEX                   = $0B01;
  432.       GL_CURRENT_NORMAL                  = $0B02;
  433.       GL_CURRENT_TEXTURE_COORDS          = $0B03;
  434.       GL_CURRENT_RASTER_COLOR            = $0B04;
  435.       GL_CURRENT_RASTER_INDEX            = $0B05;
  436.       GL_CURRENT_RASTER_TEXTURE_COORDS   = $0B06;
  437.       GL_CURRENT_RASTER_POSITION         = $0B07;
  438.       GL_CURRENT_RASTER_POSITION_VALID   = $0B08;
  439.       GL_CURRENT_RASTER_DISTANCE         = $0B09;
  440.       GL_POINT_SMOOTH                    = $0B10;
  441.       GL_POINT_SIZE                      = $0B11;
  442.       GL_POINT_SIZE_RANGE                = $0B12;
  443.       GL_POINT_SIZE_GRANULARITY          = $0B13;
  444.       GL_LINE_SMOOTH                     = $0B20;
  445.       GL_LINE_WIDTH                      = $0B21;
  446.       GL_LINE_WIDTH_RANGE                = $0B22;
  447.       GL_LINE_WIDTH_GRANULARITY          = $0B23;
  448.       GL_LINE_STIPPLE                    = $0B24;
  449.       GL_LINE_STIPPLE_PATTERN            = $0B25;
  450.       GL_LINE_STIPPLE_REPEAT             = $0B26;
  451.       GL_LIST_MODE                       = $0B30;
  452.       GL_MAX_LIST_NESTING                = $0B31;
  453.       GL_LIST_BASE                       = $0B32;
  454.       GL_LIST_INDEX                      = $0B33;
  455.       GL_POLYGON_MODE                    = $0B40;
  456.       GL_POLYGON_SMOOTH                  = $0B41;
  457.       GL_POLYGON_STIPPLE                 = $0B42;
  458.       GL_EDGE_FLAG                       = $0B43;
  459.       GL_CULL_FACE                       = $0B44;
  460.       GL_CULL_FACE_MODE                  = $0B45;
  461.       GL_FRONT_FACE                      = $0B46;
  462.       GL_LIGHTING                        = $0B50;
  463.       GL_LIGHT_MODEL_LOCAL_VIEWER        = $0B51;
  464.       GL_LIGHT_MODEL_TWO_SIDE            = $0B52;
  465.       GL_LIGHT_MODEL_AMBIENT             = $0B53;
  466.       GL_LIGHT_MODEL_COLOR_CONTROL       = $81F8; // GL 1.2
  467.       GL_SINGLE_COLOR                    = $81F9; // GL 1.2
  468.       GL_SEPARATE_SPECULAR_COLOR         = $81FA; // GL 1.2
  469.       GL_SHADE_MODEL                     = $0B54;
  470.       GL_COLOR_MATERIAL_FACE             = $0B55;
  471.       GL_COLOR_MATERIAL_PARAMETER        = $0B56;
  472.       GL_COLOR_MATERIAL                  = $0B57;
  473.       GL_FOG                             = $0B60;
  474.       GL_FOG_INDEX                       = $0B61;
  475.       GL_FOG_DENSITY                     = $0B62;
  476.       GL_FOG_START                       = $0B63;
  477.       GL_FOG_END                         = $0B64;
  478.       GL_FOG_MODE                        = $0B65;
  479.       GL_FOG_COLOR                       = $0B66;
  480.       GL_DEPTH_RANGE                     = $0B70;
  481.       GL_DEPTH_TEST                      = $0B71;
  482.       GL_DEPTH_WRITEMASK                 = $0B72;
  483.       GL_DEPTH_CLEAR_VALUE               = $0B73;
  484.       GL_DEPTH_FUNC                      = $0B74;
  485.       GL_ACCUM_CLEAR_VALUE               = $0B80;
  486.       GL_STENCIL_TEST                    = $0B90;
  487.       GL_STENCIL_CLEAR_VALUE             = $0B91;
  488.       GL_STENCIL_FUNC                    = $0B92;
  489.       GL_STENCIL_VALUE_MASK              = $0B93;
  490.       GL_STENCIL_FAIL                    = $0B94;
  491.       GL_STENCIL_PASS_DEPTH_FAIL         = $0B95;
  492.       GL_STENCIL_PASS_DEPTH_PASS         = $0B96;
  493.       GL_STENCIL_REF                     = $0B97;
  494.       GL_STENCIL_WRITEMASK               = $0B98;
  495.       GL_MATRIX_MODE                     = $0BA0;
  496.       GL_NORMALIZE                       = $0BA1;
  497.       GL_VIEWPORT                        = $0BA2;
  498.       GL_MODELVIEW_STACK_DEPTH           = $0BA3;
  499.       GL_PROJECTION_STACK_DEPTH          = $0BA4;
  500.       GL_TEXTURE_STACK_DEPTH             = $0BA5;
  501.       GL_MODELVIEW_MATRIX                = $0BA6;
  502.       GL_PROJECTION_MATRIX               = $0BA7;
  503.       GL_TEXTURE_MATRIX                  = $0BA8;
  504.       GL_ATTRIB_STACK_DEPTH              = $0BB0;
  505.       GL_CLIENT_ATTRIB_STACK_DEPTH       = $0BB1;
  506.       GL_ALPHA_TEST                      = $0BC0;
  507.       GL_ALPHA_TEST_FUNC                 = $0BC1;
  508.       GL_ALPHA_TEST_REF                  = $0BC2;
  509.       GL_DITHER                          = $0BD0;
  510.       GL_BLEND_DST                       = $0BE0;
  511.       GL_BLEND_SRC                       = $0BE1;
  512.       GL_BLEND                           = $0BE2;
  513.       GL_BLEND_COLOR                     = $8005; // GL 1.2 ARB imaging
  514.       GL_LOGIC_OP_MODE                   = $0BF0;
  515.       GL_INDEX_LOGIC_OP                  = $0BF1;
  516.       GL_LOGIC_OP                        = $0BF1;
  517.       GL_COLOR_LOGIC_OP                  = $0BF2;
  518.       GL_AUX_BUFFERS                     = $0C00;
  519.       GL_DRAW_BUFFER                     = $0C01;
  520.       GL_READ_BUFFER                     = $0C02;
  521.       GL_SCISSOR_BOX                     = $0C10;
  522.       GL_SCISSOR_TEST                    = $0C11;
  523.       GL_INDEX_CLEAR_VALUE               = $0C20;
  524.       GL_INDEX_WRITEMASK                 = $0C21;
  525.       GL_COLOR_CLEAR_VALUE               = $0C22;
  526.       GL_COLOR_WRITEMASK                 = $0C23;
  527.       GL_INDEX_MODE                      = $0C30;
  528.       GL_RGBA_MODE                       = $0C31;
  529.       GL_DOUBLEBUFFER                    = $0C32;
  530.       GL_STEREO                          = $0C33;
  531.       GL_RENDER_MODE                     = $0C40;
  532.       GL_PERSPECTIVE_CORRECTION_HINT     = $0C50;
  533.       GL_POINT_SMOOTH_HINT               = $0C51;
  534.       GL_LINE_SMOOTH_HINT                = $0C52;
  535.       GL_POLYGON_SMOOTH_HINT             = $0C53;
  536.       GL_FOG_HINT                        = $0C54;
  537.       GL_TEXTURE_GEN_S                   = $0C60;
  538.       GL_TEXTURE_GEN_T                   = $0C61;
  539.       GL_TEXTURE_GEN_R                   = $0C62;
  540.       GL_TEXTURE_GEN_Q                   = $0C63;
  541.       GL_PIXEL_MAP_I_TO_I_SIZE           = $0CB0;
  542.       GL_PIXEL_MAP_S_TO_S_SIZE           = $0CB1;
  543.       GL_PIXEL_MAP_I_TO_R_SIZE           = $0CB2;
  544.       GL_PIXEL_MAP_I_TO_G_SIZE           = $0CB3;
  545.       GL_PIXEL_MAP_I_TO_B_SIZE           = $0CB4;
  546.       GL_PIXEL_MAP_I_TO_A_SIZE           = $0CB5;
  547.       GL_PIXEL_MAP_R_TO_R_SIZE           = $0CB6;
  548.       GL_PIXEL_MAP_G_TO_G_SIZE           = $0CB7;
  549.       GL_PIXEL_MAP_B_TO_B_SIZE           = $0CB8;
  550.       GL_PIXEL_MAP_A_TO_A_SIZE           = $0CB9;
  551.       GL_UNPACK_SWAP_BYTES               = $0CF0;
  552.       GL_UNPACK_LSB_FIRST                = $0CF1;
  553.       GL_UNPACK_ROW_LENGTH               = $0CF2;
  554.       GL_UNPACK_SKIP_ROWS                = $0CF3;
  555.       GL_UNPACK_SKIP_PIXELS              = $0CF4;
  556.       GL_UNPACK_ALIGNMENT                = $0CF5;
  557.       GL_PACK_SWAP_BYTES                 = $0D00;
  558.       GL_PACK_LSB_FIRST                  = $0D01;
  559.       GL_PACK_ROW_LENGTH                 = $0D02;
  560.       GL_PACK_SKIP_ROWS                  = $0D03;
  561.       GL_PACK_SKIP_PIXELS                = $0D04;
  562.       GL_PACK_ALIGNMENT                  = $0D05;
  563.       GL_PACK_SKIP_IMAGES                = $806B; // GL 1.2
  564.       GL_PACK_IMAGE_HEIGHT               = $806C; // GL 1.2
  565.       GL_UNPACK_SKIP_IMAGES              = $806D; // GL 1.2
  566.       GL_UNPACK_IMAGE_HEIGHT             = $806E; // GL 1.2
  567.       GL_MAP_COLOR                       = $0D10;
  568.       GL_MAP_STENCIL                     = $0D11;
  569.       GL_INDEX_SHIFT                     = $0D12;
  570.       GL_INDEX_OFFSET                    = $0D13;
  571.       GL_RED_SCALE                       = $0D14;
  572.       GL_RED_BIAS                        = $0D15;
  573.       GL_ZOOM_X                          = $0D16;
  574.       GL_ZOOM_Y                          = $0D17;
  575.       GL_GREEN_SCALE                     = $0D18;
  576.       GL_GREEN_BIAS                      = $0D19;
  577.       GL_BLUE_SCALE                      = $0D1A;
  578.       GL_BLUE_BIAS                       = $0D1B;
  579.       GL_ALPHA_SCALE                     = $0D1C;
  580.       GL_ALPHA_BIAS                      = $0D1D;
  581.       GL_DEPTH_SCALE                     = $0D1E;
  582.       GL_DEPTH_BIAS                      = $0D1F;
  583.       GL_MAX_EVAL_ORDER                  = $0D30;
  584.       GL_MAX_LIGHTS                      = $0D31;
  585.       GL_MAX_CLIP_PLANES                 = $0D32;
  586.       GL_MAX_TEXTURE_SIZE                = $0D33;
  587.       GL_MAX_3D_TEXTURE_SIZE             = $8073; // GL 1.2
  588.       GL_MAX_PIXEL_MAP_TABLE             = $0D34;
  589.       GL_MAX_ATTRIB_STACK_DEPTH          = $0D35;
  590.       GL_MAX_MODELVIEW_STACK_DEPTH       = $0D36;
  591.       GL_MAX_NAME_STACK_DEPTH            = $0D37;
  592.       GL_MAX_PROJECTION_STACK_DEPTH      = $0D38;
  593.       GL_MAX_TEXTURE_STACK_DEPTH         = $0D39;
  594.       GL_MAX_VIEWPORT_DIMS               = $0D3A;
  595.       GL_MAX_CLIENT_ATTRIB_STACK_DEPTH   = $0D3B;
  596.       //GL_MAX_ELEMENTS_VERTICES           = // not yet defined; // GL 1.2
  597.       //GL_MAX_ELEMENTS_INDICES            = // not yet defined; // GL 1.2
  598.       //GL_RESCALE_NORMAL                  = // not yet defined; // GL 1.2
  599.       GL_SUBPIXEL_BITS                   = $0D50;
  600.       GL_INDEX_BITS                      = $0D51;
  601.       GL_RED_BITS                        = $0D52;
  602.       GL_GREEN_BITS                      = $0D53;
  603.       GL_BLUE_BITS                       = $0D54;
  604.       GL_ALPHA_BITS                      = $0D55;
  605.       GL_DEPTH_BITS                      = $0D56;
  606.       GL_STENCIL_BITS                    = $0D57;
  607.       GL_ACCUM_RED_BITS                  = $0D58;
  608.       GL_ACCUM_GREEN_BITS                = $0D59;
  609.       GL_ACCUM_BLUE_BITS                 = $0D5A;
  610.       GL_ACCUM_ALPHA_BITS                = $0D5B;
  611.       GL_NAME_STACK_DEPTH                = $0D70;
  612.       GL_AUTO_NORMAL                     = $0D80;
  613.       GL_MAP1_COLOR_4                    = $0D90;
  614.       GL_MAP1_INDEX                      = $0D91;
  615.       GL_MAP1_NORMAL                     = $0D92;
  616.       GL_MAP1_TEXTURE_COORD_1            = $0D93;
  617.       GL_MAP1_TEXTURE_COORD_2            = $0D94;
  618.       GL_MAP1_TEXTURE_COORD_3            = $0D95;
  619.       GL_MAP1_TEXTURE_COORD_4            = $0D96;
  620.       GL_MAP1_VERTEX_3                   = $0D97;
  621.       GL_MAP1_VERTEX_4                   = $0D98;
  622.       GL_MAP2_COLOR_4                    = $0DB0;
  623.       GL_MAP2_INDEX                      = $0DB1;
  624.       GL_MAP2_NORMAL                     = $0DB2;
  625.       GL_MAP2_TEXTURE_COORD_1            = $0DB3;
  626.       GL_MAP2_TEXTURE_COORD_2            = $0DB4;
  627.       GL_MAP2_TEXTURE_COORD_3            = $0DB5;
  628.       GL_MAP2_TEXTURE_COORD_4            = $0DB6;
  629.       GL_MAP2_VERTEX_3                   = $0DB7;
  630.       GL_MAP2_VERTEX_4                   = $0DB8;
  631.       GL_MAP1_GRID_DOMAIN                = $0DD0;
  632.       GL_MAP1_GRID_SEGMENTS              = $0DD1;
  633.       GL_MAP2_GRID_DOMAIN                = $0DD2;
  634.       GL_MAP2_GRID_SEGMENTS              = $0DD3;
  635.       GL_TEXTURE_1D                      = $0DE0;
  636.       GL_TEXTURE_2D                      = $0DE1;
  637.       GL_TEXTURE_3D                      = $806F; // GL 1.2
  638.       GL_FEEDBACK_BUFFER_POINTER         = $0DF0;
  639.       GL_FEEDBACK_BUFFER_SIZE            = $0DF1;
  640.       GL_FEEDBACK_BUFFER_TYPE            = $0DF2;
  641.       GL_SELECTION_BUFFER_POINTER        = $0DF3;
  642.       GL_SELECTION_BUFFER_SIZE           = $0DF4;
  643.       GL_POLYGON_OFFSET_UNITS            = $2A00;
  644.       GL_POLYGON_OFFSET_POINT            = $2A01;
  645.       GL_POLYGON_OFFSET_LINE             = $2A02;
  646.       GL_POLYGON_OFFSET_FILL             = $8037;
  647.       GL_POLYGON_OFFSET_FACTOR           = $8038;
  648.       GL_TEXTURE_BINDING_1D              = $8068;
  649.       GL_TEXTURE_BINDING_2D              = $8069;
  650.       GL_VERTEX_ARRAY                    = $8074;
  651.       GL_NORMAL_ARRAY                    = $8075;
  652.       GL_COLOR_ARRAY                     = $8076;
  653.       GL_INDEX_ARRAY                     = $8077;
  654.       GL_TEXTURE_COORD_ARRAY             = $8078;
  655.       GL_EDGE_FLAG_ARRAY                 = $8079;
  656.       GL_VERTEX_ARRAY_SIZE               = $807A;
  657.       GL_VERTEX_ARRAY_TYPE               = $807B;
  658.       GL_VERTEX_ARRAY_STRIDE             = $807C;
  659.       GL_NORMAL_ARRAY_TYPE               = $807E;
  660.       GL_NORMAL_ARRAY_STRIDE             = $807F;
  661.       GL_COLOR_ARRAY_SIZE                = $8081;
  662.       GL_COLOR_ARRAY_TYPE                = $8082;
  663.       GL_COLOR_ARRAY_STRIDE              = $8083;
  664.       GL_INDEX_ARRAY_TYPE                = $8085;
  665.       GL_INDEX_ARRAY_STRIDE              = $8086;
  666.       GL_TEXTURE_COORD_ARRAY_SIZE        = $8088;
  667.       GL_TEXTURE_COORD_ARRAY_TYPE        = $8089;
  668.       GL_TEXTURE_COORD_ARRAY_STRIDE      = $808A;
  669.       GL_EDGE_FLAG_ARRAY_STRIDE          = $808C;
  670.       GL_COLOR_MATRIX                    = $80B1; // GL 1.2 ARB imaging
  671.       GL_COLOR_MATRIX_STACK_DEPTH        = $80B2; // GL 1.2 ARB imaging
  672.       GL_MAX_COLOR_MATRIX_STACK_DEPTH    = $80B3; // GL 1.2 ARB imaging
  673.       GL_POST_COLOR_MATRIX_RED_SCALE     = $80B4; // GL 1.2 ARB imaging
  674.       GL_POST_COLOR_MATRIX_GREEN_SCALE   = $80B5; // GL 1.2 ARB imaging
  675.       GL_POST_COLOR_MATRIX_BLUE_SCALE    = $80B6; // GL 1.2 ARB imaging
  676.       GL_POST_COLOR_MATRIX_ALPHA_SCALE   = $80B7; // GL 1.2 ARB imaging
  677.       GL_POST_COLOR_MATRIX_RED_BIAS      = $80B8; // GL 1.2 ARB imaging
  678.       GL_POST_COLOR_MATRIX_GREEN_BIAS    = $80B9; // GL 1.2 ARB imaging
  679.       GL_POST_COLOR_MATRIX_BLUE_BIAS     = $80BA; // GL 1.2 ARB imaging
  680.       GL_POST_COLOR_MATRIX_ALPHA_BIAS    = $80BB; // GL 1.2 ARB imaging
  681.  
  682.  
  683.       // GetTextureParameter
  684.       GL_TEXTURE_WIDTH                   = $1000;
  685.       GL_TEXTURE_HEIGHT                  = $1001;
  686.       GL_TEXTURE_INTERNAL_FORMAT         = $1003;
  687.       GL_TEXTURE_COMPONENTS              = $1003;
  688.       GL_TEXTURE_BORDER_COLOR            = $1004;
  689.       GL_TEXTURE_BORDER                  = $1005;
  690.       GL_TEXTURE_RED_SIZE                = $805C;
  691.       GL_TEXTURE_GREEN_SIZE              = $805D;
  692.       GL_TEXTURE_BLUE_SIZE               = $805E;
  693.       GL_TEXTURE_ALPHA_SIZE              = $805F;
  694.       GL_TEXTURE_LUMINANCE_SIZE          = $8060;
  695.       GL_TEXTURE_INTENSITY_SIZE          = $8061;
  696.       GL_TEXTURE_PRIORITY                = $8066;
  697.       GL_TEXTURE_RESIDENT                = $8067;
  698.       GL_BGR                             = $80E0; // v 1.2
  699.       GL_BGRA                            = $80E1; // v 1.2
  700.  
  701.       // HintMode
  702.       GL_DONT_CARE                       = $1100;
  703.       GL_FASTEST                         = $1101;
  704.       GL_NICEST                          = $1102;
  705.  
  706.       // LightParameter
  707.       GL_AMBIENT                         = $1200;
  708.       GL_DIFFUSE                         = $1201;
  709.       GL_SPECULAR                        = $1202;
  710.       GL_POSITION                        = $1203;
  711.       GL_SPOT_DIRECTION                  = $1204;
  712.       GL_SPOT_EXPONENT                   = $1205;
  713.       GL_SPOT_CUTOFF                     = $1206;
  714.       GL_CONSTANT_ATTENUATION            = $1207;
  715.       GL_LINEAR_ATTENUATION              = $1208;
  716.       GL_QUADRATIC_ATTENUATION           = $1209;
  717.  
  718.       // ListMode
  719.       GL_COMPILE                         = $1300;
  720.       GL_COMPILE_AND_EXECUTE             = $1301;
  721.  
  722.       // DataType
  723.       GL_BYTE                            = $1400;
  724.       GL_UNSIGNED_BYTE                   = $1401;
  725.       GL_SHORT                           = $1402;
  726.       GL_UNSIGNED_SHORT                  = $1403;
  727.       GL_INT                             = $1404;
  728.       GL_UNSIGNED_INT                    = $1405;
  729.       GL_FLOAT                           = $1406;
  730.       GL_2_BYTES                         = $1407;
  731.       GL_3_BYTES                         = $1408;
  732.       GL_4_BYTES                         = $1409;
  733.       GL_DOUBLE                          = $140A;
  734.       GL_DOUBLE_EXT                      = $140A;
  735.  
  736.       // LogicOp
  737.       GL_CLEAR                           = $1500;
  738.       GL_AND                             = $1501;
  739.       GL_AND_REVERSE                     = $1502;
  740.       GL_COPY                            = $1503;
  741.       GL_AND_INVERTED                    = $1504;
  742.       GL_NOOP                            = $1505;
  743.       GL_XOR                             = $1506;
  744.       GL_OR                              = $1507;
  745.       GL_NOR                             = $1508;
  746.       GL_EQUIV                           = $1509;
  747.       GL_INVERT                          = $150A;
  748.       GL_OR_REVERSE                      = $150B;
  749.       GL_COPY_INVERTED                   = $150C;
  750.       GL_OR_INVERTED                     = $150D;
  751.       GL_NAND                            = $150E;
  752.       GL_SET                             = $150F;
  753.  
  754.       // MaterialParameter
  755.       GL_EMISSION                        = $1600;
  756.       GL_SHININESS                       = $1601;
  757.       GL_AMBIENT_AND_DIFFUSE             = $1602;
  758.       GL_COLOR_INDEXES                   = $1603;
  759.  
  760.       // MatrixMode
  761.       GL_MODELVIEW                       = $1700;
  762.       GL_PROJECTION                      = $1701;
  763.       GL_TEXTURE                         = $1702;
  764.  
  765.       // PixelCopyType
  766.       GL_COLOR                           = $1800;
  767.       GL_DEPTH                           = $1801;
  768.       GL_STENCIL                         = $1802;
  769.  
  770.       // PixelFormat
  771.       GL_COLOR_INDEX                     = $1900;
  772.       GL_STENCIL_INDEX                   = $1901;
  773.       GL_DEPTH_COMPONENT                 = $1902;
  774.       GL_RED                             = $1903;
  775.       GL_GREEN                           = $1904;
  776.       GL_BLUE                            = $1905;
  777.       GL_ALPHA                           = $1906;
  778.       GL_RGB                             = $1907;
  779.       GL_RGBA                            = $1908;
  780.       GL_LUMINANCE                       = $1909;
  781.       GL_LUMINANCE_ALPHA                 = $190A;
  782.  
  783.       // PixelType
  784.       GL_BITMAP                          = $1A00;
  785.  
  786.       // PolygonMode
  787.       GL_POINT                           = $1B00;
  788.       GL_LINE                            = $1B01;
  789.       GL_FILL                            = $1B02;
  790.  
  791.       // RenderingMode
  792.       GL_RENDER                          = $1C00;
  793.       GL_FEEDBACK                        = $1C01;
  794.       GL_SELECT                          = $1C02;
  795.  
  796.       // ShadingModel
  797.       GL_FLAT                            = $1D00;
  798.       GL_SMOOTH                          = $1D01;
  799.  
  800.       // StencilOp
  801.       GL_KEEP                            = $1E00;
  802.       GL_REPLACE                         = $1E01;
  803.       GL_INCR                            = $1E02;
  804.       GL_DECR                            = $1E03;
  805.  
  806.       // StringName
  807.       GL_VENDOR                          = $1F00;
  808.       GL_RENDERER                        = $1F01;
  809.       GL_VERSION                         = $1F02;
  810.       GL_EXTENSIONS                      = $1F03;
  811.  
  812.       // TextureCoordName
  813.       GL_S                               = $2000;
  814.       GL_T                               = $2001;
  815.       GL_R                               = $2002;
  816.       GL_Q                               = $2003;
  817.  
  818.       // TextureEnvMode
  819.       GL_MODULATE                        = $2100;
  820.       GL_DECAL                           = $2101;
  821.  
  822.       // TextureEnvParameter
  823.       GL_TEXTURE_ENV_MODE                = $2200;
  824.       GL_TEXTURE_ENV_COLOR               = $2201;
  825.  
  826.       // TextureEnvTarget
  827.       GL_TEXTURE_ENV                     = $2300;
  828.  
  829.       // TextureGenMode
  830.       GL_EYE_LINEAR                      = $2400;
  831.       GL_OBJECT_LINEAR                   = $2401;
  832.       GL_SPHERE_MAP                      = $2402;
  833.  
  834.       // TextureGenParameter
  835.       GL_TEXTURE_GEN_MODE                = $2500;
  836.       GL_OBJECT_PLANE                    = $2501;
  837.       GL_EYE_PLANE                       = $2502;
  838.  
  839.       // TextureMagFilter
  840.       GL_NEAREST                         = $2600;
  841.       GL_LINEAR                          = $2601;
  842.  
  843.       // TextureMinFilter
  844.       GL_NEAREST_MIPMAP_NEAREST          = $2700;
  845.       GL_LINEAR_MIPMAP_NEAREST           = $2701;
  846.       GL_NEAREST_MIPMAP_LINEAR           = $2702;
  847.       GL_LINEAR_MIPMAP_LINEAR            = $2703;
  848.  
  849.       // TextureParameterName
  850.       GL_TEXTURE_MAG_FILTER              = $2800;
  851.       GL_TEXTURE_MIN_FILTER              = $2801;
  852.       GL_TEXTURE_WRAP_R                  = $8072; // GL 1.2
  853.       GL_TEXTURE_WRAP_S                  = $2802;
  854.       GL_TEXTURE_WRAP_T                  = $2803;
  855.       GL_CLAMP_TO_EDGE                   = $812F; // GL 1.2
  856.       GL_TEXTURE_MIN_LOD                 = $813A; // GL 1.2
  857.       GL_TEXTURE_MAX_LOD                 = $813B; // GL 1.2
  858.       GL_TEXTURE_BASE_LEVEL              = $813C; // GL 1.2
  859.       GL_TEXTURE_MAX_LEVEL               = $813D; // GL 1.2
  860.       GL_TEXTURE_DEPTH                   = $8071; // GL 1.2
  861.  
  862.       // TextureTarget
  863.       GL_PROXY_TEXTURE_1D                = $8063;
  864.       GL_PROXY_TEXTURE_2D                = $8064;
  865.       GL_PROXY_TEXTURE_3D                = $8070; // GL 1.2
  866.  
  867.       // TextureWrapMode
  868.       GL_CLAMP                           = $2900;
  869.       GL_REPEAT                          = $2901;
  870.  
  871.       // PixelInternalFormat
  872.       GL_R3_G3_B2                        = $2A10;
  873.       GL_ALPHA4                          = $803B;
  874.       GL_ALPHA8                          = $803C;
  875.       GL_ALPHA12                         = $803D;
  876.       GL_ALPHA16                         = $803E;
  877.       GL_LUMINANCE4                      = $803F;
  878.       GL_LUMINANCE8                      = $8040;
  879.       GL_LUMINANCE12                     = $8041;
  880.       GL_LUMINANCE16                     = $8042;
  881.       GL_LUMINANCE4_ALPHA4               = $8043;
  882.       GL_LUMINANCE6_ALPHA2               = $8044;
  883.       GL_LUMINANCE8_ALPHA8               = $8045;
  884.       GL_LUMINANCE12_ALPHA4              = $8046;
  885.       GL_LUMINANCE12_ALPHA12             = $8047;
  886.       GL_LUMINANCE16_ALPHA16             = $8048;
  887.       GL_INTENSITY                       = $8049;
  888.       GL_INTENSITY4                      = $804A;
  889.       GL_INTENSITY8                      = $804B;
  890.       GL_INTENSITY12                     = $804C;
  891.       GL_INTENSITY16                     = $804D;
  892.       GL_RGB4                            = $804F;
  893.       GL_RGB5                            = $8050;
  894.       GL_RGB8                            = $8051;
  895.       GL_RGB10                           = $8052;
  896.       GL_RGB12                           = $8053;
  897.       GL_RGB16                           = $8054;
  898.       GL_RGBA2                           = $8055;
  899.       GL_RGBA4                           = $8056;
  900.       GL_RGB5_A1                         = $8057;
  901.       GL_RGBA8                           = $8058;
  902.       GL_RGB10_A2                        = $8059;
  903.       GL_RGBA12                          = $805A;
  904.       GL_RGBA16                          = $805B;
  905.       UNSIGNED_BYTE_3_3_2                 = $8032; // GL 1.2
  906.       UNSIGNED_BYTE_2_3_3_REV             = $8362; // GL 1.2
  907.       UNSIGNED_SHORT_5_6_5                 = $8363; // GL 1.2
  908.       UNSIGNED_SHORT_5_6_5_REV             = $8364; // GL 1.2
  909.       UNSIGNED_SHORT_4_4_4_4             = $8033; // GL 1.2
  910.       UNSIGNED_SHORT_4_4_4_4_REV         = $8365; // GL 1.2
  911.       UNSIGNED_SHORT_5_5_5_1             = $8034; // GL 1.2
  912.       UNSIGNED_SHORT_1_5_5_5_REV         = $8366; // GL 1.2
  913.       UNSIGNED_INT_8_8_8_8                 = $8035; // GL 1.2
  914.       UNSIGNED_INT_8_8_8_8_REV             = $8367; // GL 1.2
  915.       UNSIGNED_INT_10_10_10_2             = $8036; // GL 1.2
  916.       UNSIGNED_INT_2_10_10_10_REV         = $8368; // GL 1.2
  917.  
  918.       // InterleavedArrayFormat
  919.       GL_V2F                             = $2A20;
  920.       GL_V3F                             = $2A21;
  921.       GL_C4UB_V2F                        = $2A22;
  922.       GL_C4UB_V3F                        = $2A23;
  923.       GL_C3F_V3F                         = $2A24;
  924.       GL_N3F_V3F                         = $2A25;
  925.       GL_C4F_N3F_V3F                     = $2A26;
  926.       GL_T2F_V3F                         = $2A27;
  927.       GL_T4F_V4F                         = $2A28;
  928.       GL_T2F_C4UB_V3F                    = $2A29;
  929.       GL_T2F_C3F_V3F                     = $2A2A;
  930.       GL_T2F_N3F_V3F                     = $2A2B;
  931.       GL_T2F_C4F_N3F_V3F                 = $2A2C;
  932.       GL_T4F_C4F_N3F_V4F                 = $2A2D;
  933.  
  934.       // ClipPlaneName
  935.       GL_CLIP_PLANE0                     = $3000;
  936.       GL_CLIP_PLANE1                     = $3001;
  937.       GL_CLIP_PLANE2                     = $3002;
  938.       GL_CLIP_PLANE3                     = $3003;
  939.       GL_CLIP_PLANE4                     = $3004;
  940.       GL_CLIP_PLANE5                     = $3005;
  941.  
  942.       // LightName
  943.       GL_LIGHT0                          = $4000;
  944.       GL_LIGHT1                          = $4001;
  945.       GL_LIGHT2                          = $4002;
  946.       GL_LIGHT3                          = $4003;
  947.       GL_LIGHT4                          = $4004;
  948.       GL_LIGHT5                          = $4005;
  949.       GL_LIGHT6                          = $4006;
  950.       GL_LIGHT7                          = $4007;
  951.  
  952.       // ----- extensions enumerants -----
  953.       // EXT_abgr
  954.       GL_ABGR_EXT                        = $8000;
  955.  
  956.       // EXT_packed_pixels
  957.       GL_UNSIGNED_BYTE_3_3_2_EXT         = $8032;
  958.       GL_UNSIGNED_SHORT_4_4_4_4_EXT      = $8033;
  959.       GL_UNSIGNED_SHORT_5_5_5_1_EXT      = $8034;
  960.       GL_UNSIGNED_INT_8_8_8_8_EXT        = $8035;
  961.       GL_UNSIGNED_INT_10_10_10_2_EXT     = $8036;
  962.  
  963.       // EXT_vertex_array
  964.       GL_VERTEX_ARRAY_EXT                = $8074;
  965.       GL_NORMAL_ARRAY_EXT                = $8075;
  966.       GL_COLOR_ARRAY_EXT                 = $8076;
  967.       GL_INDEX_ARRAY_EXT                 = $8077;
  968.       GL_TEXTURE_COORD_ARRAY_EXT         = $8078;
  969.       GL_EDGE_FLAG_ARRAY_EXT             = $8079;
  970.       GL_VERTEX_ARRAY_SIZE_EXT           = $807A;
  971.       GL_VERTEX_ARRAY_TYPE_EXT           = $807B;
  972.       GL_VERTEX_ARRAY_STRIDE_EXT         = $807C;
  973.       GL_VERTEX_ARRAY_COUNT_EXT          = $807D;
  974.       GL_NORMAL_ARRAY_TYPE_EXT           = $807E;
  975.       GL_NORMAL_ARRAY_STRIDE_EXT         = $807F;
  976.       GL_NORMAL_ARRAY_COUNT_EXT          = $8080;
  977.       GL_COLOR_ARRAY_SIZE_EXT            = $8081;
  978.       GL_COLOR_ARRAY_TYPE_EXT            = $8082;
  979.       GL_COLOR_ARRAY_STRIDE_EXT          = $8083;
  980.       GL_COLOR_ARRAY_COUNT_EXT           = $8084;
  981.       GL_INDEX_ARRAY_TYPE_EXT            = $8085;
  982.       GL_INDEX_ARRAY_STRIDE_EXT          = $8086;
  983.       GL_INDEX_ARRAY_COUNT_EXT           = $8087;
  984.       GL_TEXTURE_COORD_ARRAY_SIZE_EXT    = $8088;
  985.       GL_TEXTURE_COORD_ARRAY_TYPE_EXT    = $8089;
  986.       GL_TEXTURE_COORD_ARRAY_STRIDE_EXT  = $808A;
  987.       GL_TEXTURE_COORD_ARRAY_COUNT_EXT   = $808B;
  988.       GL_EDGE_FLAG_ARRAY_STRIDE_EXT      = $808C;
  989.       GL_EDGE_FLAG_ARRAY_COUNT_EXT       = $808D;
  990.       GL_VERTEX_ARRAY_POINTER_EXT        = $808E;
  991.       GL_NORMAL_ARRAY_POINTER_EXT        = $808F;
  992.       GL_COLOR_ARRAY_POINTER_EXT         = $8090;
  993.       GL_INDEX_ARRAY_POINTER_EXT         = $8091;
  994.       GL_TEXTURE_COORD_ARRAY_POINTER_EXT = $8092;
  995.       GL_EDGE_FLAG_ARRAY_POINTER_EXT     = $8093;
  996.  
  997.       // EXT_color_table
  998.       GL_TABLE_TOO_LARGE_EXT             = $8031;
  999.       GL_COLOR_TABLE_FORMAT_EXT          = $80D8;
  1000.       GL_COLOR_TABLE_WIDTH_EXT           = $80D9;
  1001.       GL_COLOR_TABLE_RED_SIZE_EXT        = $80DA;
  1002.       GL_COLOR_TABLE_GREEN_SIZE_EXT      = $80DB;
  1003.       GL_COLOR_TABLE_BLUE_SIZE_EXT       = $80DC;
  1004.       GL_COLOR_TABLE_ALPHA_SIZE_EXT      = $80DD;
  1005.       GL_COLOR_TABLE_LUMINANCE_SIZE_EXT  = $80DE;
  1006.       GL_COLOR_TABLE_INTENSITY_SIZE_EXT  = $80DF;
  1007.  
  1008.       // EXT_bgra
  1009.       GL_BGR_EXT                         = $80E0;
  1010.       GL_BGRA_EXT                        = $80E1;
  1011.  
  1012.       // EXT_paletted_texture
  1013.       GL_COLOR_INDEX1_EXT                = $80E2;
  1014.       GL_COLOR_INDEX2_EXT                = $80E3;
  1015.       GL_COLOR_INDEX4_EXT                = $80E4;
  1016.       GL_COLOR_INDEX8_EXT                = $80E5;
  1017.       GL_COLOR_INDEX12_EXT               = $80E6;
  1018.       GL_COLOR_INDEX16_EXT               = $80E7;
  1019.  
  1020.       // SGI_compiled_vertex_array
  1021.       GL_ARRAY_ELEMENT_LOCK_FIRST_SGI    = $81A8;
  1022.       GL_ARRAY_ELEMENT_LOCK_COUNT_SGI    = $81A9;
  1023.  
  1024.       // SGI_cull_vertex
  1025.       GL_CULL_VERTEX_SGI                 = $81AA;
  1026.       GL_CULL_VERTEX_EYE_POSITION_SGI    = $81AB;
  1027.       GL_CULL_VERTEX_OBJECT_POSITION_SGI = $81AC;
  1028.  
  1029.       // SGI_index_array_formats
  1030.       GL_IUI_V2F_SGI                     = $81AD;
  1031.       GL_IUI_V3F_SGI                     = $81AE;
  1032.       GL_IUI_N3F_V2F_SGI                 = $81AF;
  1033.       GL_IUI_N3F_V3F_SGI                 = $81B0;
  1034.       GL_T2F_IUI_V2F_SGI                 = $81B1;
  1035.       GL_T2F_IUI_V3F_SGI                 = $81B2;
  1036.       GL_T2F_IUI_N3F_V2F_SGI             = $81B3;
  1037.       GL_T2F_IUI_N3F_V3F_SGI             = $81B4;
  1038.  
  1039.       // SGI_index_func
  1040.       GL_INDEX_TEST_SGI                  = $81B5;
  1041.       GL_INDEX_TEST_FUNC_SGI             = $81B6;
  1042.       GL_INDEX_TEST_REF_SGI              = $81B7;
  1043.  
  1044.       // SGI_index_material
  1045.       GL_INDEX_MATERIAL_SGI              = $81B8;
  1046.       GL_INDEX_MATERIAL_PARAMETER_SGI    = $81B9;
  1047.       GL_INDEX_MATERIAL_FACE_SGI         = $81BA;
  1048.  
  1049.       // EXT_blend_color
  1050.       GL_CONSTANT_COLOR_EXT              = $8001;
  1051.       GL_ONE_MINUS_CONSTANT_COLOR_EXT    = $8002;
  1052.       GL_CONSTANT_ALPHA_EXT              = $8003;
  1053.       GL_ONE_MINUS_CONSTANT_ALPHA_EXT    = $8004;
  1054.       GL_BLEND_COLOR_EXT                 = $8005;
  1055.  
  1056.       // EXT_blend_minmax
  1057.       GL_FUNC_ADD_EXT                    = $8006;
  1058.       GL_MIN_EXT                         = $8007;
  1059.       GL_MAX_EXT                         = $8008;
  1060.       GL_BLEND_EQUATION_EXT              = $8009;
  1061.  
  1062.       // EXT_blend_subtract
  1063.       GL_FUNC_SUBTRACT_EXT               = $800A;
  1064.       GL_FUNC_REVERSE_SUBTRACT_EXT       = $800B;
  1065.  
  1066.       // EXT_convolution
  1067.       GL_CONVOLUTION_1D_EXT              = $8010;
  1068.       GL_CONVOLUTION_2D_EXT              = $8011;
  1069.       GL_SEPARABLE_2D_EXT                = $8012;
  1070.       GL_CONVOLUTION_BORDER_MODE_EXT     = $8013;
  1071.       GL_CONVOLUTION_FILTER_SCALE_EXT    = $8014;
  1072.       GL_CONVOLUTION_FILTER_BIAS_EXT     = $8015;
  1073.       GL_REDUCE_EXT                      = $8016;
  1074.       GL_CONVOLUTION_FORMAT_EXT          = $8017;
  1075.       GL_CONVOLUTION_WIDTH_EXT           = $8018;
  1076.       GL_CONVOLUTION_HEIGHT_EXT          = $8019;
  1077.       GL_MAX_CONVOLUTION_WIDTH_EXT       = $801A;
  1078.       GL_MAX_CONVOLUTION_HEIGHT_EXT      = $801B;
  1079.       GL_POST_CONVOLUTION_RED_SCALE_EXT  = $801C;
  1080.       GL_POST_CONVOLUTION_GREEN_SCALE_EXT = $801D;
  1081.       GL_POST_CONVOLUTION_BLUE_SCALE_EXT = $801E;
  1082.       GL_POST_CONVOLUTION_ALPHA_SCALE_EXT = $801F;
  1083.       GL_POST_CONVOLUTION_RED_BIAS_EXT   = $8020;
  1084.       GL_POST_CONVOLUTION_GREEN_BIAS_EXT = $8021;
  1085.       GL_POST_CONVOLUTION_BLUE_BIAS_EXT  = $8022;
  1086.       GL_POST_CONVOLUTION_ALPHA_BIAS_EXT = $8023;
  1087.  
  1088.       // EXT_histogram
  1089.       GL_HISTOGRAM_EXT                   = $8024;
  1090.       GL_PROXY_HISTOGRAM_EXT             = $8025;
  1091.       GL_HISTOGRAM_WIDTH_EXT             = $8026;
  1092.       GL_HISTOGRAM_FORMAT_EXT            = $8027;
  1093.       GL_HISTOGRAM_RED_SIZE_EXT          = $8028;
  1094.       GL_HISTOGRAM_GREEN_SIZE_EXT        = $8029;
  1095.       GL_HISTOGRAM_BLUE_SIZE_EXT         = $802A;
  1096.       GL_HISTOGRAM_ALPHA_SIZE_EXT        = $802B;
  1097.       GL_HISTOGRAM_LUMINANCE_SIZE_EXT    = $802C;
  1098.       GL_HISTOGRAM_SINK_EXT              = $802D;
  1099.       GL_MINMAX_EXT                      = $802E;
  1100.       GL_MINMAX_FORMAT_EXT               = $802F;
  1101.       GL_MINMAX_SINK_EXT                 = $8030;
  1102.  
  1103.       // EXT_polygon_offset
  1104.       GL_POLYGON_OFFSET_EXT              = $8037;
  1105.       GL_POLYGON_OFFSET_FACTOR_EXT       = $8038;
  1106.       GL_POLYGON_OFFSET_BIAS_EXT         = $8039;
  1107.  
  1108.       // EXT_texture
  1109.       GL_ALPHA4_EXT                      = $803B;
  1110.       GL_ALPHA8_EXT                      = $803C;
  1111.       GL_ALPHA12_EXT                     = $803D;
  1112.       GL_ALPHA16_EXT                     = $803E;
  1113.       GL_LUMINANCE4_EXT                  = $803F;
  1114.       GL_LUMINANCE8_EXT                  = $8040;
  1115.       GL_LUMINANCE12_EXT                 = $8041;
  1116.       GL_LUMINANCE16_EXT                 = $8042;
  1117.       GL_LUMINANCE4_ALPHA4_EXT           = $8043;
  1118.       GL_LUMINANCE6_ALPHA2_EXT           = $8044;
  1119.       GL_LUMINANCE8_ALPHA8_EXT           = $8045;
  1120.       GL_LUMINANCE12_ALPHA4_EXT          = $8046;
  1121.       GL_LUMINANCE12_ALPHA12_EXT         = $8047;
  1122.       GL_LUMINANCE16_ALPHA16_EXT         = $8048;
  1123.       GL_INTENSITY_EXT                   = $8049;
  1124.       GL_INTENSITY4_EXT                  = $804A;
  1125.       GL_INTENSITY8_EXT                  = $804B;
  1126.       GL_INTENSITY12_EXT                 = $804C;
  1127.       GL_INTENSITY16_EXT                 = $804D;
  1128.       GL_RGB2_EXT                        = $804E;
  1129.       GL_RGB4_EXT                        = $804F;
  1130.       GL_RGB5_EXT                        = $8050;
  1131.       GL_RGB8_EXT                        = $8051;
  1132.       GL_RGB10_EXT                       = $8052;
  1133.       GL_RGB12_EXT                       = $8053;
  1134.       GL_RGB16_EXT                       = $8054;
  1135.       GL_RGBA2_EXT                       = $8055;
  1136.       GL_RGBA4_EXT                       = $8056;
  1137.       GL_RGB5_A1_EXT                     = $8057;
  1138.       GL_RGBA8_EXT                       = $8058;
  1139.       GL_RGB10_A2_EXT                    = $8059;
  1140.       GL_RGBA12_EXT                      = $805A;
  1141.       GL_RGBA16_EXT                      = $805B;
  1142.       GL_TEXTURE_RED_SIZE_EXT            = $805C;
  1143.       GL_TEXTURE_GREEN_SIZE_EXT          = $805D;
  1144.       GL_TEXTURE_BLUE_SIZE_EXT           = $805E;
  1145.       GL_TEXTURE_ALPHA_SIZE_EXT          = $805F;
  1146.       GL_TEXTURE_LUMINANCE_SIZE_EXT      = $8060;
  1147.       GL_TEXTURE_INTENSITY_SIZE_EXT      = $8061;
  1148.       GL_REPLACE_EXT                     = $8062;
  1149.       GL_PROXY_TEXTURE_1D_EXT            = $8063;
  1150.       GL_PROXY_TEXTURE_2D_EXT            = $8064;
  1151.       GL_TEXTURE_TOO_LARGE_EXT           = $8065;
  1152.  
  1153.       // EXT_texture_object 
  1154.       GL_TEXTURE_PRIORITY_EXT            = $8066;
  1155.       GL_TEXTURE_RESIDENT_EXT            = $8067;
  1156.       GL_TEXTURE_1D_BINDING_EXT          = $8068;
  1157.       GL_TEXTURE_2D_BINDING_EXT          = $8069;
  1158.       GL_TEXTURE_3D_BINDING_EXT          = $806A;
  1159.  
  1160.       // EXT_texture3D
  1161.       GL_PACK_SKIP_IMAGES_EXT            = $806B;
  1162.       GL_PACK_IMAGE_HEIGHT_EXT           = $806C;
  1163.       GL_UNPACK_SKIP_IMAGES_EXT          = $806D;
  1164.       GL_UNPACK_IMAGE_HEIGHT_EXT         = $806E;
  1165.       GL_TEXTURE_3D_EXT                  = $806F;
  1166.       GL_PROXY_TEXTURE_3D_EXT            = $8070;
  1167.       GL_TEXTURE_DEPTH_EXT               = $8071;
  1168.       GL_TEXTURE_WRAP_R_EXT              = $8072;
  1169.       GL_MAX_3D_TEXTURE_SIZE_EXT         = $8073;
  1170.  
  1171.       // SGI_color_matrix
  1172.       GL_COLOR_MATRIX_SGI                = $80B1;
  1173.       GL_COLOR_MATRIX_STACK_DEPTH_SGI    = $80B2;
  1174.       GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI = $80B3;
  1175.       GL_POST_COLOR_MATRIX_RED_SCALE_SGI = $80B4;
  1176.       GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI = $80B5;
  1177.       GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI = $80B6;
  1178.       GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI = $80B7;
  1179.       GL_POST_COLOR_MATRIX_RED_BIAS_SGI  = $80B8;
  1180.       GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI = $80B9;
  1181.       GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI = $80BA;
  1182.       GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI = $80BB;
  1183.  
  1184.       // SGI_texture_color_table
  1185.       GL_TEXTURE_COLOR_TABLE_SGI          = $80BC;
  1186.       GL_PROXY_TEXTURE_COLOR_TABLE_SGI    = $80BD;
  1187.       GL_TEXTURE_COLOR_TABLE_BIAS_SGI     = $80BE;
  1188.       GL_TEXTURE_COLOR_TABLE_SCALE_SGI    = $80BF;
  1189.  
  1190.       // SGI_color_table
  1191.       GL_COLOR_TABLE_SGI                  = $80D0;
  1192.       GL_POST_CONVOLUTION_COLOR_TABLE_SGI = $80D1;
  1193.       GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI = $80D2;
  1194.       GL_PROXY_COLOR_TABLE_SGI            = $80D3;
  1195.       GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI = $80D4;
  1196.       GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI = $80D5;
  1197.       GL_COLOR_TABLE_SCALE_SGI            = $80D6;
  1198.       GL_COLOR_TABLE_BIAS_SGI             = $80D7;
  1199.       GL_COLOR_TABLE_FORMAT_SGI           = $80D8;
  1200.       GL_COLOR_TABLE_WIDTH_SGI            = $80D9;
  1201.       GL_COLOR_TABLE_RED_SIZE_SGI         = $80DA;
  1202.       GL_COLOR_TABLE_GREEN_SIZE_SGI       = $80DB;
  1203.       GL_COLOR_TABLE_BLUE_SIZE_SGI        = $80DC;
  1204.       GL_COLOR_TABLE_ALPHA_SIZE_SGI       = $80DD;
  1205.       GL_COLOR_TABLE_LUMINANCE_SIZE_SGI   = $80DE;
  1206.       GL_COLOR_TABLE_INTENSITY_SIZE_SGI   = $80DF;
  1207.  
  1208.       // EXT_cmyka
  1209.       GL_CMYK_EXT                         = $800C;
  1210.       GL_CMYKA_EXT                        = $800D;
  1211.       GL_PACK_CMYK_HINT_EXT               = $800E;
  1212.       GL_UNPACK_CMYK_HINT_EXT             = $800F;
  1213.  
  1214.       // EXT_rescale_normal
  1215.       GL_RESCALE_NORMAL_EXT               = $803A;
  1216.  
  1217.       // EXT_clip_volume_hint
  1218.       GL_CLIP_VOLUME_CLIPPING_HINT_EXT      = $80F0;
  1219.  
  1220.       // EXT_cull_vertex
  1221.       GL_CULL_VERTEX_EXT                  = 0; // not yet defined
  1222.       GL_CULL_VERTEX_EYE_POSITION_EXT     = 0; // not yet defined
  1223.       GL_CULL_VERTEX_OBJECT_POSITION_EXT  = 0; // not yet defined
  1224.  
  1225.       // EXT_index_array_formats
  1226.       GL_IUI_V2F_EXT                      = 0; // not yet defined
  1227.       GL_IUI_V3F_EXT                      = 0; // not yet defined
  1228.       GL_IUI_N3F_V2F_EXT                  = 0; // not yet defined
  1229.       GL_IUI_N3F_V3F_EXT                  = 0; // not yet defined
  1230.       GL_T2F_IUI_V2F_EXT                  = 0; // not yet defined
  1231.       GL_T2F_IUI_V3F_EXT                  = 0; // not yet defined
  1232.       GL_T2F_IUI_N3F_V2F_EXT              = 0; // not yet defined
  1233.       GL_T2F_IUI_N3F_V3F_EXT              = 0; // not yet defined
  1234.  
  1235.       // EXT_index_func
  1236.       GL_INDEX_TEST_EXT                   = 0; // not yet defined
  1237.       GL_INDEX_TEST_FUNC_EXT              = 0; // not yet defined
  1238.       GL_INDEX_TEST_REF_EXT               = 0; // not yet defined
  1239.  
  1240.       // EXT_index_material
  1241.       GL_INDEX_MATERIAL_EXT               = 0; // not yet defined
  1242.       GL_INDEX_MATERIAL_PARAMETER_EXT     = 0; // not yet defined
  1243.       GL_INDEX_MATERIAL_FACE_EXT          = 0; // not yet defined
  1244.  
  1245.       // EXT_misc_attribute
  1246.       GL_MISC_BIT_EXT                     = 0; // not yet defined
  1247.  
  1248.       // EXT_scene_marker
  1249.       GL_SCENE_REQUIRED_EXT               = 0; // not yet defined
  1250.  
  1251.       // EXT_shared_texture_palette
  1252.       GL_SHARED_TEXTURE_PALETTE_EXT          = $81FB;
  1253.  
  1254.       // EXT_nurbs_tessellator
  1255.       GLU_NURBS_MODE_EXT                 = 100160;
  1256.       GLU_NURBS_TESSELLATOR_EXT          = 100161;
  1257.       GLU_NURBS_RENDERER_EXT             = 100162;
  1258.       GLU_NURBS_BEGIN_EXT                = 100164;
  1259.       GLU_NURBS_VERTEX_EXT               = 100165;
  1260.       GLU_NURBS_NORMAL_EXT               = 100166;
  1261.       GLU_NURBS_COLOR_EXT                = 100167;
  1262.       GLU_NURBS_TEX_COORD_EXT            = 100168;
  1263.       GLU_NURBS_END_EXT                  = 100169;
  1264.       GLU_NURBS_BEGIN_DATA_EXT           = 100170;
  1265.       GLU_NURBS_VERTEX_DATA_EXT          = 100171;
  1266.       GLU_NURBS_NORMAL_DATA_EXT          = 100172;
  1267.       GLU_NURBS_COLOR_DATA_EXT           = 100173;
  1268.       GLU_NURBS_TEX_COORD_DATA_EXT       = 100174;
  1269.       GLU_NURBS_END_DATA_EXT             = 100175;
  1270.  
  1271.       // EXT_object_space_tess
  1272.       GLU_OBJECT_PARAMETRIC_ERROR_EXT    = 100208;
  1273.       GLU_OBJECT_PATH_LENGTH_EXT         = 100209;
  1274.  
  1275. //------------------------------------------------------------------------------
  1276.  
  1277. const // ********** GLU generic constants **********
  1278.  
  1279.       // Errors: (return value 0 = no error)
  1280.       GLU_INVALID_ENUM                   = 100900;
  1281.       GLU_INVALID_VALUE                  = 100901;
  1282.       GLU_OUT_OF_MEMORY                  = 100902;
  1283.       GLU_INCOMPATIBLE_GL_VERSION        = 100903;
  1284.  
  1285.       // StringName
  1286.       GLU_VERSION                        = 100800;
  1287.       GLU_EXTENSIONS                     = 100801;
  1288.  
  1289.       // Boolean
  1290.       GLU_TRUE                           = GL_TRUE;
  1291.       GLU_FALSE                          = GL_FALSE;
  1292.  
  1293.       // Quadric constants
  1294.       // QuadricNormal
  1295.       GLU_SMOOTH                         = 100000;
  1296.       GLU_FLAT                           = 100001;
  1297.       GLU_NONE                           = 100002;
  1298.  
  1299.       // QuadricDrawStyle
  1300.       GLU_POINT                          = 100010;
  1301.       GLU_LINE                           = 100011;
  1302.       GLU_FILL                           = 100012;
  1303.       GLU_SILHOUETTE                     = 100013;
  1304.  
  1305.       // QuadricOrientation
  1306.       GLU_OUTSIDE                        = 100020;
  1307.       GLU_INSIDE                         = 100021;
  1308.  
  1309.       // Tesselation constants
  1310.  
  1311.       GLU_TESS_MAX_COORD                 = 1.0e150;
  1312.  
  1313.       // TessProperty
  1314.       GLU_TESS_WINDING_RULE              = 100140;
  1315.       GLU_TESS_BOUNDARY_ONLY             = 100141;
  1316.       GLU_TESS_TOLERANCE                 = 100142;
  1317.  
  1318.       // TessWinding
  1319.       GLU_TESS_WINDING_ODD               = 100130;
  1320.       GLU_TESS_WINDING_NONZERO           = 100131;
  1321.       GLU_TESS_WINDING_POSITIVE          = 100132;
  1322.       GLU_TESS_WINDING_NEGATIVE          = 100133;
  1323.       GLU_TESS_WINDING_ABS_GEQ_TWO       = 100134;
  1324.  
  1325.       // TessCallback
  1326.       GLU_TESS_BEGIN                     = 100100; // TGLUTessBeginProc
  1327.       GLU_TESS_VERTEX                    = 100101; // TGLUTessVertexProc
  1328.       GLU_TESS_END                       = 100102; // TGLUTessEndProc
  1329.       GLU_TESS_ERROR                     = 100103; // TGLUTessErrorProc
  1330.       GLU_TESS_EDGE_FLAG                 = 100104; // TGLUTessEdgeFlagProc
  1331.       GLU_TESS_COMBINE                   = 100105; // TGLUTessCombineProc
  1332.       GLU_TESS_BEGIN_DATA                = 100106; // TGLUTessBeginDataProc
  1333.       GLU_TESS_VERTEX_DATA               = 100107; // TGLUTessVertexDataProc
  1334.       GLU_TESS_END_DATA                  = 100108; // TGLUTessEndDataProc
  1335.       GLU_TESS_ERROR_DATA                = 100109; // TGLUTessErrorDataProc
  1336.       GLU_TESS_EDGE_FLAG_DATA            = 100110; // TGLUTessEdgeFlagDataProc
  1337.       GLU_TESS_COMBINE_DATA              = 100111; // TGLUTessCombineDataProc
  1338.  
  1339.       // TessError
  1340.       GLU_TESS_ERROR1                    = 100151;
  1341.       GLU_TESS_ERROR2                    = 100152;
  1342.       GLU_TESS_ERROR3                    = 100153;
  1343.       GLU_TESS_ERROR4                    = 100154;
  1344.       GLU_TESS_ERROR5                    = 100155;
  1345.       GLU_TESS_ERROR6                    = 100156;
  1346.       GLU_TESS_ERROR7                    = 100157;
  1347.       GLU_TESS_ERROR8                    = 100158;
  1348.  
  1349.       GLU_TESS_MISSING_BEGIN_POLYGON     = GLU_TESS_ERROR1;
  1350.       GLU_TESS_MISSING_BEGIN_CONTOUR     = GLU_TESS_ERROR2;
  1351.       GLU_TESS_MISSING_END_POLYGON       = GLU_TESS_ERROR3;
  1352.       GLU_TESS_MISSING_END_CONTOUR       = GLU_TESS_ERROR4;
  1353.       GLU_TESS_COORD_TOO_LARGE           = GLU_TESS_ERROR5;
  1354.       GLU_TESS_NEED_COMBINE_CALLBACK     = GLU_TESS_ERROR6;
  1355.  
  1356.       // NURBS constants
  1357.  
  1358.       // NurbsProperty
  1359.       GLU_AUTO_LOAD_MATRIX               = 100200;
  1360.       GLU_CULLING                        = 100201;
  1361.       GLU_SAMPLING_TOLERANCE             = 100203;
  1362.       GLU_DISPLAY_MODE                   = 100204;
  1363.       GLU_PARAMETRIC_TOLERANCE           = 100202;
  1364.       GLU_SAMPLING_METHOD                = 100205;
  1365.       GLU_U_STEP                         = 100206;
  1366.       GLU_V_STEP                         = 100207;
  1367.  
  1368.       // NurbsSampling
  1369.       GLU_PATH_LENGTH                    = 100215;
  1370.       GLU_PARAMETRIC_ERROR               = 100216;
  1371.       GLU_DOMAIN_DISTANCE                = 100217;
  1372.  
  1373.       // NurbsTrim
  1374.       GLU_MAP1_TRIM_2                    = 100210;
  1375.       GLU_MAP1_TRIM_3                    = 100211;
  1376.  
  1377.       // NurbsDisplay
  1378.       GLU_OUTLINE_POLYGON                = 100240;
  1379.       GLU_OUTLINE_PATCH                  = 100241;
  1380.  
  1381.       // NurbsErrors
  1382.       GLU_NURBS_ERROR1                   = 100251;
  1383.       GLU_NURBS_ERROR2                   = 100252;
  1384.       GLU_NURBS_ERROR3                   = 100253;
  1385.       GLU_NURBS_ERROR4                   = 100254;
  1386.       GLU_NURBS_ERROR5                   = 100255;
  1387.       GLU_NURBS_ERROR6                   = 100256;
  1388.       GLU_NURBS_ERROR7                   = 100257;
  1389.       GLU_NURBS_ERROR8                   = 100258;
  1390.       GLU_NURBS_ERROR9                   = 100259;
  1391.       GLU_NURBS_ERROR10                  = 100260;
  1392.       GLU_NURBS_ERROR11                  = 100261;
  1393.       GLU_NURBS_ERROR12                  = 100262;
  1394.       GLU_NURBS_ERROR13                  = 100263;
  1395.       GLU_NURBS_ERROR14                  = 100264;
  1396.       GLU_NURBS_ERROR15                  = 100265;
  1397.       GLU_NURBS_ERROR16                  = 100266;
  1398.       GLU_NURBS_ERROR17                  = 100267;
  1399.       GLU_NURBS_ERROR18                  = 100268;
  1400.       GLU_NURBS_ERROR19                  = 100269;
  1401.       GLU_NURBS_ERROR20                  = 100270;
  1402.       GLU_NURBS_ERROR21                  = 100271;
  1403.       GLU_NURBS_ERROR22                  = 100272;
  1404.       GLU_NURBS_ERROR23                  = 100273;
  1405.       GLU_NURBS_ERROR24                  = 100274;
  1406.       GLU_NURBS_ERROR25                  = 100275;
  1407.       GLU_NURBS_ERROR26                  = 100276;
  1408.       GLU_NURBS_ERROR27                  = 100277;
  1409.       GLU_NURBS_ERROR28                  = 100278;
  1410.       GLU_NURBS_ERROR29                  = 100279;
  1411.       GLU_NURBS_ERROR30                  = 100280;
  1412.       GLU_NURBS_ERROR31                  = 100281;
  1413.       GLU_NURBS_ERROR32                  = 100282;
  1414.       GLU_NURBS_ERROR33                  = 100283;
  1415.       GLU_NURBS_ERROR34                  = 100284;
  1416.       GLU_NURBS_ERROR35                  = 100285;
  1417.       GLU_NURBS_ERROR36                  = 100286;
  1418.       GLU_NURBS_ERROR37                  = 100287;
  1419.  
  1420.       // Contours types -- obsolete!
  1421.       GLU_CW                             = 100120;
  1422.       GLU_CCW                            = 100121;
  1423.       GLU_INTERIOR                       = 100122;
  1424.       GLU_EXTERIOR                       = 100123;
  1425.       GLU_UNKNOWN                        = 100124;
  1426.  
  1427.       // Names without "TESS_" prefix
  1428.       GLU_BEGIN                          = GLU_TESS_BEGIN;
  1429.       GLU_VERTEX                         = GLU_TESS_VERTEX;
  1430.       GLU_END                            = GLU_TESS_END;
  1431.       GLU_ERROR                          = GLU_TESS_ERROR;
  1432.       GLU_EDGE_FLAG                      = GLU_TESS_EDGE_FLAG;
  1433.  
  1434. //------------------------------------------------------------------------------
  1435.  
  1436. // GLU types:
  1437.  
  1438. type  TGLUNurbs           = record end;
  1439.       TGLUQuadric         = record end;
  1440.       TGLUTesselator      = record end;
  1441.  
  1442.       PGLUNurbs           = ^TGLUNurbs;
  1443.       PGLUQuadric         = ^TGLUQuadric;
  1444.       PGLUTesselator      = ^TGLUTesselator;
  1445.  
  1446.       // backwards compatibility:
  1447.       TGLUNurbsObj        = TGLUNurbs;
  1448.       TGLUQuadricObj      = TGLUQuadric;
  1449.       TGLUTesselatorObj   = TGLUTesselator;
  1450.       TGLUTriangulatorObj = TGLUTesselator;
  1451.  
  1452.       PGLUNurbsObj        = PGLUNurbs;
  1453.       PGLUQuadricObj      = PGLUQuadric;
  1454.       PGLUTesselatorObj   = PGLUTesselator;
  1455.       PGLUTriangulatorObj = PGLUTesselator;
  1456.  
  1457.       // Callback function prototypes
  1458.       // GLUQuadricCallback 
  1459.       TGLUQuadricErrorProc = procedure(errorCode: GLenum); stdcall;
  1460.  
  1461.       // GLUTessCallback 
  1462.       TGLUTessBeginProc    = procedure(AType: GLenum); stdcall;
  1463.       TGLUTessEdgeFlagProc = procedure(Flag: GLboolean); stdcall;
  1464.       TGLUTessVertexProc   = procedure(VertexData: Pointer); stdcall;
  1465.       TGLUTessEndProc      = procedure; stdcall;
  1466.       TGLUTessErrorProc    = procedure(ErrNo: GLenum); stdcall;
  1467.       TGLUTessCombineProc  = procedure(Coords: TVector3d; VertexData: TVector4p; Weight: TVector4f; OutData: PPointer); stdcall;
  1468.       TGLUTessBeginDataProc    = procedure(AType: GLenum; UserData: Pointer); stdcall;
  1469.       TGLUTessEdgeFlagDataProc = procedure(Flag: GLboolean; UserData: Pointer); stdcall;
  1470.       TGLUTessVertexDataProc   = procedure(VertexData: Pointer; UserData: Pointer); stdcall;
  1471.       TGLUTessEndDataProc      = procedure(UserData: Pointer); stdcall;
  1472.       TGLUTessErrorDataProc    = procedure(ErrNo: GLenum; UserData: Pointer); stdcall;
  1473.       TGLUTessCombineDataProc  = procedure(Coords: TVector3d; VertexData: TVector4p; Weight: TVector4f; OutData: PPointer; UserData: Pointer); stdcall;
  1474.  
  1475.       // GLUNurbsCallback
  1476.       TGLUNurbsErrorProc = procedure(ErrorCode: GLenum); stdcall;
  1477.  
  1478. //------------------------------------------------------------------------------
  1479.  
  1480. const // additional constants, which are not defined in Windows.pas
  1481.  
  1482.       // TLayerPlaneDescriptor flags
  1483.       LPD_DOUBLEBUFFER    = $00000001;
  1484.       LPD_STEREO          = $00000002;
  1485.       LPD_SUPPORT_GDI     = $00000010;
  1486.       LPD_SUPPORT_OPENGL  = $00000020;
  1487.       LPD_SHARE_DEPTH     = $00000040;
  1488.       LPD_SHARE_STENCIL   = $00000080;
  1489.       LPD_SHARE_ACCUM     = $00000100;
  1490.       LPD_SWAP_EXCHANGE   = $00000200;
  1491.       LPD_SWAP_COPY       = $00000400;
  1492.       LPD_TRANSPARENT     = $00001000;
  1493.  
  1494.       LPD_TYPE_RGBA       = 0;
  1495.       LPD_TYPE_COLORINDEX = 1;
  1496.  
  1497.       // wglSwapLayerBuffers flags
  1498.       WGL_SWAP_MAIN_PLANE = $00000001;
  1499.       WGL_SWAP_OVERLAY1   = $00000002;
  1500.       WGL_SWAP_OVERLAY2   = $00000004;
  1501.       WGL_SWAP_OVERLAY3   = $00000008;
  1502.       WGL_SWAP_OVERLAY4   = $00000010;
  1503.       WGL_SWAP_OVERLAY5   = $00000020;
  1504.       WGL_SWAP_OVERLAY6   = $00000040;
  1505.       WGL_SWAP_OVERLAY7   = $00000080;
  1506.       WGL_SWAP_OVERLAY8   = $00000100;
  1507.       WGL_SWAP_OVERLAY9   = $00000200;
  1508.       WGL_SWAP_OVERLAY10  = $00000400;
  1509.       WGL_SWAP_OVERLAY11  = $00000800;
  1510.       WGL_SWAP_OVERLAY12  = $00001000;
  1511.       WGL_SWAP_OVERLAY13  = $00002000;
  1512.       WGL_SWAP_OVERLAY14  = $00004000;
  1513.       WGL_SWAP_OVERLAY15  = $00008000;
  1514.       WGL_SWAP_UNDERLAY1  = $00010000;
  1515.       WGL_SWAP_UNDERLAY2  = $00020000;
  1516.       WGL_SWAP_UNDERLAY3  = $00040000;
  1517.       WGL_SWAP_UNDERLAY4  = $00080000;
  1518.       WGL_SWAP_UNDERLAY5  = $00100000;
  1519.       WGL_SWAP_UNDERLAY6  = $00200000;
  1520.       WGL_SWAP_UNDERLAY7  = $00400000;
  1521.       WGL_SWAP_UNDERLAY8  = $00800000;
  1522.       WGL_SWAP_UNDERLAY9  = $01000000;
  1523.       WGL_SWAP_UNDERLAY10 = $02000000;
  1524.       WGL_SWAP_UNDERLAY11 = $04000000;
  1525.       WGL_SWAP_UNDERLAY12 = $08000000;
  1526.       WGL_SWAP_UNDERLAY13 = $10000000;
  1527.       WGL_SWAP_UNDERLAY14 = $20000000;
  1528.       WGL_SWAP_UNDERLAY15 = $40000000;
  1529.  
  1530. type PLayerPlaneDescriptor = ^TLayerPlaneDescriptor;
  1531.      TLayerPlaneDescriptor = packed record
  1532.                                nSize,
  1533.                                nVersion        : Word;
  1534.                                dwFlags         : Integer;
  1535.                                iPixelType,
  1536.                                cColorBits,
  1537.                                cRedBits,
  1538.                                cRedShift,
  1539.                                cGreenBits,
  1540.                                cGreenShift,
  1541.                                cBlueBits,
  1542.                                cBlueShift,
  1543.                                cAlphaBits,
  1544.                                cAlphaShift,
  1545.                                cAccumBits,
  1546.                                cAccumRedBits,
  1547.                                cAccumGreenBits,
  1548.                                cAccumBlueBits,
  1549.                                cAccumAlphaBits,
  1550.                                cDepthBits,
  1551.                                cStencilBits,
  1552.                                cAuxBuffers,
  1553.                                iLayerPlane,
  1554.                                bReserved         : Byte;
  1555.                                crTransparent     : Integer;
  1556.                              end;
  1557.  
  1558. //------------------------------------------------------------------------------
  1559.  
  1560. // GL functions and procedures:
  1561.  
  1562. var glAccum : procedure(op: GLuint; value: GLfloat); stdcall;
  1563.     glAlphaFunc : procedure(func: GLenum; ref: GLclampf); stdcall;
  1564.     glAreTexturesResident : function(n: GLsizei; Textures: PGLuint; residences: PGLboolean): GLboolean; stdcall;
  1565.     glArrayElement : procedure(i: GLint); stdcall;
  1566.     glBegin : procedure(mode: GLenum); stdcall;
  1567.     glBindTexture : procedure(target: GLenum; texture: GLuint); stdcall;
  1568.     glBitmap : procedure(width: GLsizei; height: GLsizei; xorig, yorig: GLfloat; xmove: GLfloat; ymove: GLfloat; bitmap: Pointer); stdcall;
  1569.     glBlendFunc : procedure(sfactor: GLenum; dfactor: GLenum); stdcall;
  1570.     glCallList : procedure(list: GLuint); stdcall;
  1571.     glCallLists : procedure(n: GLsizei; atype: GLenum; lists: Pointer); stdcall;
  1572.     glClear : procedure(mask: GLbitfield); stdcall;
  1573.     glClearAccum : procedure(red, green, blue, alpha: GLfloat); stdcall;
  1574.     glClearColor : procedure(red, green, blue, alpha: GLclampf); stdcall; 
  1575.     glClearDepth : procedure(depth: GLclampd); stdcall; 
  1576.     glClearIndex : procedure(c: GLfloat); stdcall;
  1577.     glClearStencil : procedure(s: GLint ); stdcall; 
  1578.     glClipPlane : procedure(plane: GLenum; equation: PGLdouble); stdcall; 
  1579.     glColor3b : procedure(red, green, blue: GLbyte); stdcall; 
  1580.     glColor3bv : procedure(v: PGLbyte); stdcall; 
  1581.     glColor3d : procedure(red, green, blue: GLdouble); stdcall;
  1582.     glColor3dv : procedure(v: PGLdouble); stdcall; 
  1583.     glColor3f : procedure(red, green, blue: GLfloat); stdcall; 
  1584.     glColor3fv : procedure(v: PGLfloat); stdcall;
  1585.     glColor3i : procedure(red, green, blue: GLint); stdcall; 
  1586.     glColor3iv : procedure(v: PGLint); stdcall; 
  1587.     glColor3s : procedure(red, green, blue: GLshort); stdcall; 
  1588.     glColor3sv : procedure(v: PGLshort); stdcall; 
  1589.     glColor3ub : procedure(red, green, blue: GLubyte); stdcall;
  1590.     glColor3ubv : procedure(v: PGLubyte); stdcall;
  1591.     glColor3ui : procedure(red, green, blue: GLuint); stdcall; 
  1592.     glColor3uiv : procedure(v: PGLuint); stdcall; 
  1593.     glColor3us : procedure(red, green, blue: GLushort); stdcall; 
  1594.     glColor3usv : procedure(v: PGLushort); stdcall;
  1595.     glColor4b : procedure(red, green, blue, alpha: GLbyte); stdcall; 
  1596.     glColor4bv : procedure(v: PGLbyte); stdcall; 
  1597.     glColor4d : procedure(red, green, blue, alpha: GLdouble ); stdcall; 
  1598.     glColor4dv : procedure(v: PGLdouble); stdcall; 
  1599.     glColor4f : procedure(red, green, blue, alpha: GLfloat); stdcall; 
  1600.     glColor4fv : procedure(v: PGLfloat); stdcall; 
  1601.     glColor4i : procedure(red, green, blue, alpha: GLint); stdcall;
  1602.     glColor4iv : procedure(v: PGLint); stdcall;
  1603.     glColor4s : procedure(red, green, blue, alpha: GLshort); stdcall;
  1604.     glColor4sv : procedure(v: GLshort); stdcall;
  1605.     glColor4ub : procedure(red, green, blue, alpha: GLubyte); stdcall;
  1606.     glColor4ubv : procedure(v: PGLubyte); stdcall;
  1607.     glColor4ui : procedure(red, green, blue, alpha: GLuint); stdcall;
  1608.     glColor4uiv : procedure(v: PGLuint); stdcall;
  1609.     glColor4us : procedure(red, green, blue, alpha: GLushort); stdcall;
  1610.     glColor4usv : procedure(v: PGLushort); stdcall;
  1611.     glColorMask : procedure(red, green, blue, alpha: GLboolean); stdcall;
  1612.     glColorMaterial : procedure(face: GLenum; mode: GLenum); stdcall;
  1613.     glColorPointer : procedure(size: GLint; atype: GLenum; stride: GLsizei; data: pointer); stdcall;
  1614.     glCopyPixels : procedure(x, y: GLint; width, height: GLsizei; atype: GLenum); stdcall;
  1615.     glCopyTexImage1D : procedure(target: GLenum; level: GLint; internalFormat: GLenum; x, y: GLint; width: GLsizei; border: GLint); stdcall;
  1616.     glCopyTexImage2D : procedure(target: GLenum; level: GLint; internalFormat: GLenum; x, y: GLint; width, height: GLsizei; border: GLint); stdcall;
  1617.     glCopyTexSubImage1D : procedure(target: GLenum; level, xoffset, x, y: GLint; width: GLsizei); stdcall;
  1618.     glCopyTexSubImage2D : procedure(target: GLenum; level, xoffset, yoffset, x, y: GLint; width, height: GLsizei); stdcall;
  1619.     glCullFace : procedure(mode: GLenum); stdcall;
  1620.     glDeleteLists : procedure(list: GLuint; range: GLsizei); stdcall;
  1621.     glDeleteTextures : procedure(n: GLsizei; textures: PGLuint); stdcall;
  1622.     glDepthFunc : procedure(func: GLenum); stdcall;
  1623.     glDepthMask : procedure(flag: GLboolean); stdcall; 
  1624.     glDepthRange : procedure(zNear, zFar: GLclampd); stdcall; 
  1625.     glDisable : procedure(cap: GLenum); stdcall; 
  1626.     glDisableClientState : procedure(aarray: GLenum); stdcall; 
  1627.     glDrawArrays : procedure(mode: GLenum; first: GLint; count: GLsizei); stdcall; 
  1628.     glDrawBuffer : procedure(mode: GLenum); stdcall; 
  1629.     glDrawElements : procedure(mode: GLenum; count: GLsizei; atype: GLenum; indices: Pointer); stdcall; 
  1630.     glDrawPixels : procedure(width, height: GLsizei; format, atype: GLenum; pixels: Pointer); stdcall; 
  1631.     glEdgeFlag : procedure(flag: GLboolean); stdcall; 
  1632.     glEdgeFlagPointer : procedure(stride: GLsizei; data: pointer); stdcall; 
  1633.     glEdgeFlagv : procedure(flag: PGLboolean); stdcall;
  1634.     glEnable : procedure(cap: GLenum); stdcall;
  1635.     glEnableClientState : procedure(aarray: GLenum); stdcall;
  1636.     glEnd : procedure; stdcall;
  1637.     glEndList : procedure; stdcall; 
  1638.     glEvalCoord1d : procedure(u: GLdouble); stdcall; 
  1639.     glEvalCoord1dv : procedure(u: PGLdouble); stdcall; 
  1640.     glEvalCoord1f : procedure(u: GLfloat); stdcall; 
  1641.     glEvalCoord1fv : procedure(u: PGLfloat); stdcall; 
  1642.     glEvalCoord2d : procedure(u: GLdouble; v: GLdouble); stdcall;
  1643.     glEvalCoord2dv : procedure(u: PGLdouble); stdcall; 
  1644.     glEvalCoord2f : procedure(u, v: GLfloat); stdcall; 
  1645.     glEvalCoord2fv : procedure(u: PGLfloat); stdcall;
  1646.     glEvalMesh1 : procedure(mode: GLenum; i1, i2: GLint); stdcall; 
  1647.     glEvalMesh2 : procedure(mode: GLenum; i1, i2, j1, j2: GLint); stdcall;
  1648.     glEvalPoint1 : procedure(i: GLint); stdcall;
  1649.     glEvalPoint2 : procedure(i, j: GLint); stdcall; 
  1650.     glFeedbackBuffer : procedure(size: GLsizei; atype: GLenum; buffer: PGLfloat); stdcall; 
  1651.     glFinish : procedure; stdcall;
  1652.     glFlush : procedure; stdcall; 
  1653.     glFogf : procedure(pname: GLenum; param: GLfloat); stdcall;
  1654.     glFogfv : procedure(pname: GLenum; params: PGLfloat); stdcall; 
  1655.     glFogi : procedure(pname: GLenum; param: GLint); stdcall;
  1656.     glFogiv : procedure(pname: GLenum; params: PGLint); stdcall; 
  1657.     glFrontFace : procedure(mode: GLenum); stdcall;
  1658.     glFrustum : procedure(left, right, bottom, top, zNear, zFar: GLdouble); stdcall; 
  1659.     glGenLists : function(range: GLsizei): GLuint; stdcall;
  1660.     glGenTextures : procedure(n: GLsizei; textures: PGLuint); stdcall;
  1661.     glGetBooleanv : procedure(pname: GLenum; params: PGLboolean); stdcall;
  1662.     glGetClipPlane : procedure(plane: GLenum; equation: PGLdouble); stdcall;
  1663.     glGetDoublev : procedure(pname: GLenum; params: PGLdouble); stdcall;
  1664.     glGetError : function : GLuint; stdcall; 
  1665.     glGetFloatv : procedure(pname: GLenum; params: PGLfloat); stdcall; 
  1666.     glGetIntegerv : procedure(pname: GLenum; params: PGLint); stdcall;
  1667.     glGetLightfv : procedure(light, pname: GLenum; params: PGLfloat); stdcall;
  1668.     glGetLightiv : procedure(light, pname: GLenum; params: PGLint); stdcall;
  1669.     glGetMapdv : procedure(target, query: GLenum; v: PGLdouble); stdcall; 
  1670.     glGetMapfv : procedure(target, query: GLenum; v: PGLfloat); stdcall; 
  1671.     glGetMapiv : procedure(target, query: GLenum; v: PGLint); stdcall; 
  1672.     glGetMaterialfv : procedure(face, pname: GLenum; params: PGLfloat); stdcall; 
  1673.     glGetMaterialiv : procedure(face, pname: GLenum; params: PGLint); stdcall; 
  1674.     glGetPixelMapfv : procedure(map: GLenum; values: PGLfloat); stdcall; 
  1675.     glGetPixelMapuiv : procedure(map: GLenum; values: PGLuint); stdcall; 
  1676.     glGetPixelMapusv : procedure(map: GLenum; values: PGLushort); stdcall; 
  1677.     glGetPointerv : procedure(pname: GLenum; params: Pointer); stdcall; 
  1678.     glGetPolygonStipple : procedure(mask: PGLubyte); stdcall;
  1679.     glGetString : function(name: GLenum): PGLubyte; stdcall;
  1680.     glGetTexEnvfv : procedure(target, pname: GLenum; params: PGLfloat); stdcall;
  1681.     glGetTexEnviv : procedure(target, pname: GLenum; params: PGLint); stdcall;
  1682.     glGetTexGendv : procedure(coord, pname: GLenum; params: PGLdouble); stdcall;
  1683.     glGetTexGenfv : procedure(coord, pname: GLenum; params: PGLfloat); stdcall; 
  1684.     glGetTexGeniv : procedure(coord, pname: GLenum; params: PGLint); stdcall;
  1685.     glGetTexImage : procedure(target: GLenum; level: GLint; format, atype: GLenum; pixels: Pointer); stdcall; 
  1686.     glGetTexLevelParameterfv : procedure(target: GLenum; level: GLint; pname: GLenum; params: PGLfloat); stdcall;
  1687.     glGetTexLevelParameteriv : procedure(target: GLenum; level: GLint; pname: GLenum; params: PGLint); stdcall;
  1688.     glGetTexParameterfv : procedure(target, pname: GLenum; params: PGLfloat); stdcall;
  1689.     glGetTexParameteriv : procedure(target, pname: GLenum; params: PGLint); stdcall; 
  1690.     glHint : procedure(target, mode: GLenum); stdcall; 
  1691.     glIndexMask : procedure(mask: GLuint); stdcall;
  1692.     glIndexPointer : procedure(atype: GLenum; stride: GLsizei; data: pointer); stdcall; 
  1693.     glIndexd : procedure(c: GLdouble); stdcall;
  1694.     glIndexdv : procedure(c: PGLdouble); stdcall; 
  1695.     glIndexf : procedure(c: GLfloat); stdcall; 
  1696.     glIndexfv : procedure(c: PGLfloat); stdcall; 
  1697.     glIndexi : procedure(c: GLint); stdcall; 
  1698.     glIndexiv : procedure(c: PGLint); stdcall;
  1699.     glIndexs : procedure(c: GLshort); stdcall;
  1700.     glIndexsv : procedure(c: PGLshort); stdcall;
  1701.     glIndexub : procedure(c: GLubyte); stdcall; 
  1702.     glIndexubv : procedure(c: PGLubyte); stdcall; 
  1703.     glInitNames : procedure; stdcall;
  1704.     glInterleavedArrays : procedure(format: GLenum; stride: GLsizei; data: pointer); stdcall; 
  1705.     glIsEnabled : function(cap: GLenum): GLboolean; stdcall;
  1706.     glIsList : function(list: GLuint): GLboolean; stdcall;
  1707.     glIsTexture : function(texture: GLuint): GLboolean; stdcall;
  1708.     glLightModelf : procedure(pname: GLenum; param: GLfloat); stdcall;
  1709.     glLightModelfv : procedure(pname: GLenum; params: PGLfloat); stdcall;
  1710.     glLightModeli : procedure(pname: GLenum; param: GLint); stdcall;
  1711.     glLightModeliv : procedure(pname: GLenum; params: PGLint); stdcall;
  1712.     glLightf : procedure(light, pname: GLenum; param: GLfloat); stdcall;
  1713.     glLightfv : procedure(light, pname: GLenum; params: PGLfloat); stdcall;
  1714.     glLighti : procedure(light, pname: GLenum; param: GLint); stdcall;
  1715.     glLightiv : procedure(light, pname: GLenum; params: PGLint); stdcall; 
  1716.     glLineStipple : procedure(factor: GLint; pattern: GLushort); stdcall; 
  1717.     glLineWidth : procedure(width: GLfloat); stdcall;
  1718.     glListBase : procedure(base: GLuint); stdcall;
  1719.     glLoadIdentity : procedure; stdcall;
  1720.     glLoadMatrixd : procedure(m: PGLdouble); stdcall;
  1721.     glLoadMatrixf : procedure(m: PGLfloat); stdcall;
  1722.     glLoadName : procedure(name: GLuint); stdcall; 
  1723.     glLogicOp : procedure(opcode: GLenum); stdcall;
  1724.     glMap1d : procedure(target: GLenum; u1, u2: GLdouble; stride, order: GLint; points: PGLdouble); stdcall;
  1725.     glMap1f : procedure(target: GLenum; u1, u2: GLfloat; stride, order: GLint; points: PGLfloat);   stdcall;
  1726.     glMap2d : procedure(target: GLenum; u1, u2: GLdouble; ustride, uorder: GLint; v1, v2: GLdouble; vstride, vorder: GLint; points: PGLdouble); stdcall;
  1727.     glMap2f : procedure(target: GLenum; u1, u2: GLfloat; ustride, uorder: GLint; v1, v2: GLfloat; vstride, vorder: GLint; points: PGLfloat); stdcall;
  1728.     glMapGrid1d : procedure(un: GLint; u1, u2: GLdouble); stdcall;
  1729.     glMapGrid1f : procedure(un: GLint; u1, u2: GLfloat); stdcall;
  1730.     glMapGrid2d : procedure(un: GLint; u1, u2: GLdouble; vn: GLint; v1, v2: GLdouble); stdcall;
  1731.     glMapGrid2f : procedure(un: GLint; u1, u2: GLfloat; vn: GLint; v1, v2: GLfloat); stdcall;
  1732.     glMaterialf : procedure(face, pname: GLenum; param: GLfloat); stdcall;
  1733.     glMaterialfv : procedure(face, pname: GLenum; params: PGLfloat); stdcall;
  1734.     glMateriali : procedure(face, pname: GLenum; param: GLint); stdcall;
  1735.     glMaterialiv : procedure(face, pname: GLenum; params: PGLint); stdcall;
  1736.     glMatrixMode : procedure(mode: GLenum); stdcall;
  1737.     glMultMatrixd : procedure(m: PGLdouble); stdcall;
  1738.     glMultMatrixf : procedure(m: PGLfloat); stdcall;
  1739.     glNewList : procedure(list: GLuint; mode: GLenum); stdcall;
  1740.     glNormal3b : procedure(nx, ny, nz: GLbyte); stdcall;
  1741.     glNormal3bv : procedure(v: PGLbyte); stdcall;
  1742.     glNormal3d : procedure(nx, ny, nz: GLdouble); stdcall;
  1743.     glNormal3dv : procedure(v: PGLdouble); stdcall;
  1744.     glNormal3f : procedure(nx, ny, nz: GLfloat); stdcall;
  1745.     glNormal3fv : procedure(v: PGLfloat); stdcall;
  1746.     glNormal3i : procedure(nx, ny, nz: GLint); stdcall;
  1747.     glNormal3iv : procedure(v: PGLint); stdcall;
  1748.     glNormal3s : procedure(nx, ny, nz: GLshort); stdcall;
  1749.     glNormal3sv : procedure(v: PGLshort); stdcall; 
  1750.     glNormalPointer : procedure(atype: GLenum; stride: GLsizei; data: pointer); stdcall;
  1751.     glOrtho : procedure(left, right, bottom, top, zNear, zFar: GLdouble); stdcall; 
  1752.     glPassThrough : procedure(token: GLfloat); stdcall; 
  1753.     glPixelMapfv : procedure(map: GLenum; mapsize: GLsizei; values: PGLfloat); stdcall;
  1754.     glPixelMapuiv : procedure(map: GLenum; mapsize: GLsizei; values: PGLuint); stdcall;
  1755.     glPixelMapusv : procedure(map: GLenum; mapsize: GLsizei; values: PGLushort); stdcall;
  1756.     glPixelStoref : procedure(pname: GLenum; param: GLfloat); stdcall;
  1757.     glPixelStorei : procedure(pname: GLenum; param: GLint); stdcall;
  1758.     glPixelTransferf : procedure(pname: GLenum; param: GLfloat); stdcall;
  1759.     glPixelTransferi : procedure(pname: GLenum; param: GLint); stdcall;
  1760.     glPixelZoom : procedure(xfactor, yfactor: GLfloat); stdcall;
  1761.     glPointSize : procedure(size: GLfloat); stdcall;
  1762.     glPolygonMode : procedure(face, mode: GLenum); stdcall;
  1763.     glPolygonOffset : procedure(factor, units: GLfloat); stdcall;
  1764.     glPolygonStipple : procedure(mask: PGLubyte); stdcall;
  1765.     glPopAttrib : procedure; stdcall;
  1766.     glPopClientAttrib : procedure; stdcall;
  1767.     glPopMatrix : procedure; stdcall;
  1768.     glPopName : procedure; stdcall;
  1769.     glPrioritizeTextures : procedure(n: GLsizei; textures: PGLuint; priorities: PGLclampf); stdcall;
  1770.     glPushAttrib : procedure(mask: GLbitfield); stdcall; 
  1771.     glPushClientAttrib : procedure(mask: GLbitfield); stdcall; 
  1772.     glPushMatrix : procedure; stdcall; 
  1773.     glPushName : procedure(name: GLuint); stdcall; 
  1774.     glRasterPos2d : procedure(x, y: GLdouble); stdcall; 
  1775.     glRasterPos2dv : procedure(v: PGLdouble); stdcall; 
  1776.     glRasterPos2f : procedure(x, y: GLfloat); stdcall; 
  1777.     glRasterPos2fv : procedure(v: PGLfloat); stdcall; 
  1778.     glRasterPos2i : procedure(x, y: GLint); stdcall; 
  1779.     glRasterPos2iv : procedure(v: PGLint); stdcall;
  1780.     glRasterPos2s : procedure(x, y: PGLshort); stdcall;
  1781.     glRasterPos2sv : procedure(v: PGLshort); stdcall; 
  1782.     glRasterPos3d : procedure(x, y, z: GLdouble); stdcall; 
  1783.     glRasterPos3dv : procedure(v: PGLdouble); stdcall; 
  1784.     glRasterPos3f : procedure(x, y, z: GLfloat); stdcall; 
  1785.     glRasterPos3fv : procedure(v: PGLfloat); stdcall; 
  1786.     glRasterPos3i : procedure(x, y, z: GLint); stdcall;
  1787.     glRasterPos3iv : procedure(v: PGLint); stdcall;
  1788.     glRasterPos3s : procedure(x, y, z: GLshort); stdcall; 
  1789.     glRasterPos3sv : procedure(v: PGLshort); stdcall;
  1790.     glRasterPos4d : procedure(x, y, z, w: GLdouble); stdcall; 
  1791.     glRasterPos4dv : procedure(v: PGLdouble); stdcall; 
  1792.     glRasterPos4f : procedure(x, y, z, w: GLfloat); stdcall;
  1793.     glRasterPos4fv : procedure(v: PGLfloat); stdcall;
  1794.     glRasterPos4i : procedure(x, y, z, w: GLint); stdcall;
  1795.     glRasterPos4iv : procedure(v: PGLint); stdcall;
  1796.     glRasterPos4s : procedure(x, y, z, w: GLshort); stdcall; 
  1797.     glRasterPos4sv : procedure(v: PGLshort); stdcall; 
  1798.     glReadBuffer : procedure(mode: GLenum); stdcall; 
  1799.     glReadPixels : procedure(x, y: GLint; width, height: GLsizei; format, atype: GLenum; pixels: Pointer); stdcall;
  1800.     glRectd : procedure(x1, y1, x2, y2: GLdouble); stdcall;
  1801.     glRectdv : procedure(v1, v2: PGLdouble); stdcall;
  1802.     glRectf : procedure(x1, y1, x2, y2: GLfloat); stdcall; 
  1803.     glRectfv : procedure(v1, v2: PGLfloat); stdcall; 
  1804.     glRecti : procedure(x1, y1, x2, y2: GLint); stdcall; 
  1805.     glRectiv : procedure(v1, v2: PGLint); stdcall; 
  1806.     glRects : procedure(x1, y1, x2, y2: GLshort); stdcall; 
  1807.     glRectsv : procedure(v1, v2: PGLshort); stdcall; 
  1808.     glRenderMode : function(mode: GLenum): GLint; stdcall;
  1809.     glRotated : procedure(angle, x, y, z: GLdouble); stdcall;
  1810.     glRotatef : procedure(angle, x, y, z: GLfloat); stdcall; 
  1811.     glScaled : procedure(x, y, z: GLdouble); stdcall; 
  1812.     glScalef : procedure(x, y, z: GLfloat); stdcall;
  1813.     glScissor : procedure(x, y: GLint; width, height: GLsizei); stdcall; 
  1814.     glSelectBuffer : procedure(size: GLsizei; buffer: PGLuint); stdcall; 
  1815.     glShadeModel : procedure(mode: GLenum); stdcall; 
  1816.     glStencilFunc : procedure(func: GLenum; ref: GLint; mask: GLuint); stdcall; 
  1817.     glStencilMask : procedure(mask: GLuint); stdcall;
  1818.     glStencilOp : procedure(fail, zfail, zpass: GLenum); stdcall; 
  1819.     glTexCoord1d : procedure(s: GLdouble); stdcall; 
  1820.     glTexCoord1dv : procedure(v: PGLdouble); stdcall;
  1821.     glTexCoord1f : procedure(s: GLfloat); stdcall; 
  1822.     glTexCoord1fv : procedure(v: PGLfloat); stdcall;
  1823.     glTexCoord1i : procedure(s: GLint); stdcall; 
  1824.     glTexCoord1iv : procedure(v: PGLint); stdcall; 
  1825.     glTexCoord1s : procedure(s: GLshort); stdcall;
  1826.     glTexCoord1sv : procedure(v: PGLshort); stdcall;
  1827.     glTexCoord2d : procedure(s, t: GLdouble); stdcall;
  1828.     glTexCoord2dv : procedure(v: PGLdouble); stdcall;
  1829.     glTexCoord2f : procedure(s, t: GLfloat); stdcall; 
  1830.     glTexCoord2fv : procedure(v: PGLfloat); stdcall; 
  1831.     glTexCoord2i : procedure(s, t: GLint); stdcall;
  1832.     glTexCoord2iv : procedure(v: PGLint); stdcall;
  1833.     glTexCoord2s : procedure(s, t: GLshort); stdcall;
  1834.     glTexCoord2sv : procedure(v: PGLshort); stdcall;
  1835.     glTexCoord3d : procedure(s, t, r: GLdouble); stdcall;
  1836.     glTexCoord3dv : procedure(v: PGLdouble); stdcall;
  1837.     glTexCoord3f : procedure(s, t, r: GLfloat); stdcall;
  1838.     glTexCoord3fv : procedure(v: PGLfloat); stdcall;
  1839.     glTexCoord3i : procedure(s, t, r: GLint); stdcall;
  1840.     glTexCoord3iv : procedure(v: PGLint); stdcall;
  1841.     glTexCoord3s : procedure(s, t, r: GLshort); stdcall;
  1842.     glTexCoord3sv : procedure(v: PGLshort); stdcall;
  1843.     glTexCoord4d : procedure(s, t, r, q: GLdouble); stdcall;
  1844.     glTexCoord4dv : procedure(v: PGLdouble); stdcall;
  1845.     glTexCoord4f : procedure(s, t, r, q: GLfloat); stdcall;
  1846.     glTexCoord4fv : procedure(v: PGLfloat); stdcall;
  1847.     glTexCoord4i : procedure(s, t, r, q: GLint); stdcall;
  1848.     glTexCoord4iv : procedure(v: PGLint); stdcall;
  1849.     glTexCoord4s : procedure(s, t, r, q: GLshort); stdcall;
  1850.     glTexCoord4sv : procedure(v: PGLshort); stdcall;
  1851.     glTexCoordPointer : procedure(size: GLint; atype: GLenum; stride: GLsizei; data: pointer); stdcall;
  1852.     glTexEnvf : procedure(target, pname: GLenum; param: GLfloat); stdcall; 
  1853.     glTexEnvfv : procedure(target, pname: GLenum; params: PGLfloat); stdcall;
  1854.     glTexEnvi : procedure(target, pname: GLenum; param: GLint); stdcall; 
  1855.     glTexEnviv : procedure(target, pname: GLenum; params: PGLint); stdcall; 
  1856.     glTexGend : procedure(coord, pname: GLenum; param: GLdouble); stdcall; 
  1857.     glTexGendv : procedure(coord, pname: GLenum; params: PGLdouble); stdcall;
  1858.     glTexGenf : procedure(coord, pname: GLenum; param: GLfloat); stdcall;
  1859.     glTexGenfv : procedure(coord, pname: GLenum; params: PGLfloat); stdcall;
  1860.     glTexGeni : procedure(coord, pname: GLenum; param: GLint); stdcall; 
  1861.     glTexGeniv : procedure(coord, pname: GLenum; params: PGLint); stdcall;
  1862.     glTexImage1D : procedure(target: GLenum; level, internalformat: GLint; width: GLsizei; border: GLint; format, atype: GLenum; pixels: Pointer); stdcall;
  1863.     glTexImage2D : procedure(target: GLenum; level, internalformat: GLint; width, height: GLsizei; border: GLint; format, atype: GLenum; Pixels:Pointer); stdcall;
  1864.     glTexParameterf : procedure(target, pname: GLenum; param: GLfloat); stdcall;
  1865.     glTexParameterfv : procedure(target, pname: GLenum; params: PGLfloat); stdcall;
  1866.     glTexParameteri : procedure(target, pname: GLenum; param: GLint); stdcall;
  1867.     glTexParameteriv : procedure(target, pname: GLenum; params: PGLint); stdcall;
  1868.     glTexSubImage1D : procedure(target: GLenum; level, xoffset: GLint; width: GLsizei; format, atype: GLenum; pixels: Pointer); stdcall;
  1869.     glTexSubImage2D : procedure(target: GLenum; level, xoffset, yoffset: GLint; width, height: GLsizei; format, atype: GLenum; pixels: Pointer); stdcall;
  1870.     glTranslated : procedure(x, y, z: GLdouble); stdcall;
  1871.     glTranslatef : procedure(x, y, z: GLfloat); stdcall;
  1872.     glVertex2d : procedure(x, y: GLdouble); stdcall;
  1873.     glVertex2dv : procedure(v: PGLdouble); stdcall;
  1874.     glVertex2f : procedure(x, y: GLfloat); stdcall;
  1875.     glVertex2fv : procedure(v: PGLfloat); stdcall;
  1876.     glVertex2i : procedure(x, y: GLint); stdcall;
  1877.     glVertex2iv : procedure(v: PGLint); stdcall;
  1878.     glVertex2s : procedure(x, y: GLshort); stdcall;
  1879.     glVertex2sv : procedure(v: PGLshort); stdcall;
  1880.     glVertex3d : procedure(x, y, z: GLdouble); stdcall;
  1881.     glVertex3dv : procedure(v: PGLdouble); stdcall; 
  1882.     glVertex3f : procedure(x, y, z: GLfloat); stdcall; 
  1883.     glVertex3fv : procedure(v: PGLfloat); stdcall; 
  1884.     glVertex3i : procedure(x, y, z: GLint); stdcall; 
  1885.     glVertex3iv : procedure(v: PGLint); stdcall; 
  1886.     glVertex3s : procedure(x, y, z: GLshort); stdcall;
  1887.     glVertex3sv : procedure(v: PGLshort); stdcall;
  1888.     glVertex4d : procedure(x, y, z, w: GLdouble); stdcall;
  1889.     glVertex4dv : procedure(v: PGLdouble); stdcall;
  1890.     glVertex4f : procedure(x, y, z, w: GLfloat); stdcall;
  1891.     glVertex4fv : procedure(v: PGLfloat); stdcall;
  1892.     glVertex4i : procedure(x, y, z, w: GLint); stdcall;
  1893.     glVertex4iv : procedure(v: PGLint); stdcall;
  1894.     glVertex4s : procedure(x, y, z, w: GLshort); stdcall;
  1895.     glVertex4sv : procedure(v: PGLshort); stdcall;
  1896.     glVertexPointer : procedure(size: GLint; atype: GLenum; stride: GLsizei; data: pointer); stdcall;
  1897.     glViewport : procedure(x, y: GLint; width, height: GLsizei); stdcall;
  1898.  
  1899.     // GL 1.2
  1900.     glDrawRangeElements: procedure(mode: GLenum; Astart, Aend: GLuint; count: GLsizei; Atype: GLenum; indices: Pointer); stdcall;
  1901.     glTexImage3D: procedure(target: GLenum; level: GLint; internalformat: GLenum; width, height, depth: GLsizei; border: GLint; format: GLenum; Atype: GLenum; pixels: Pointer); stdcall;
  1902.     // GL 1.2 ARB imaging
  1903.     glBlendColor: procedure(red, green, blue, alpha: GLclampf); stdcall;
  1904.     glBlendEquation: procedure(mode: GLenum); stdcall;
  1905.     glColorSubTable: procedure(target: GLenum; start, count: GLsizei; format, Atype: GLenum; data: Pointer); stdcall;
  1906.     glCopyColorSubTable: procedure(target: GLenum; start: GLsizei; x, y: GLint; width: GLsizei); stdcall;
  1907.     glColorTable: procedure(target, internalformat: GLenum; width: GLsizei; format, Atype: GLenum; table: Pointer); stdcall;
  1908.     glCopyColorTable: procedure(target, internalformat: GLenum; x, y: GLint; width: GLsizei); stdcall;
  1909.     glColorTableParameteriv: procedure(target, pname: GLenum; params: PGLint); stdcall;
  1910.     glColorTableParameterfv: procedure(target, pname: GLenum; params: PGLfloat); stdcall;
  1911.     glGetColorTable: procedure(target, format, Atype: GLenum; table: Pointer); stdcall;
  1912.     glGetColorTableParameteriv: procedure(target, pname: GLenum; params: PGLint); stdcall;
  1913.     glGetColorTableParameterfv: procedure(target, pname: GLenum; params: PGLfloat); stdcall;
  1914.     glConvolutionFilter1D: procedure(target, internalformat: GLenum; width: GLsizei; format, Atype: GLenum; image: Pointer); stdcall;
  1915.     glConvolutionFilter2D: procedure(target, internalformat: GLenum; width, height: GLsizei; format, Atype: GLenum; image: Pointer); stdcall;
  1916.     glCopyConvolutionFilter1D: procedure(target, internalformat: GLenum; x, y: GLint; width: GLsizei); stdcall;
  1917.     glCopyConvolutionFilter2D: procedure(target, internalformat: GLenum; x, y: GLint; width, height: GLsizei); stdcall;
  1918.     glGetConvolutionFilter: procedure(target, internalformat, Atype: GLenum; image: Pointer); stdcall;
  1919.     glSeparableFilter2D: procedure(target, internalformat: GLenum; width, height: GLsizei; format, Atype: GLenum; row, column: Pointer); stdcall;
  1920.     glGetSeparableFilter: procedure(target, format, Atype: GLenum; row, column, span: Pointer); stdcall;
  1921.     glConvolutionParameteri: procedure(target, pname: GLenum; param: GLint); stdcall;
  1922.     glConvolutionParameteriv: procedure(target, pname: GLenum; params: PGLint); stdcall;
  1923.     glConvolutionParameterf: procedure(target, pname: GLenum; param: GLfloat); stdcall;
  1924.     glConvolutionParameterfv: procedure(target, pname: GLenum; params: PGLfloat); stdcall;
  1925.     glGetConvolutionParameteriv: procedure(target, pname: GLenum; params: PGLint); stdcall;
  1926.     glGetConvolutionParameterfv: procedure(target, pname: GLenum; params: PGLfloat); stdcall;
  1927.     glHistogram: procedure(target: GLenum; width: GLsizei; internalformat: GLenum; sink: GLboolean); stdcall;
  1928.     glResetHistogram: procedure(target: GLenum); stdcall;
  1929.     glGetHistogram: procedure(target: GLenum; reset: GLboolean; format, Atype: GLenum; values: Pointer); stdcall;
  1930.     glGetHistogramParameteriv: procedure(target, pname: GLenum; params: PGLint); stdcall;
  1931.     glGetHistogramParameterfv: procedure(target, pname: GLenum; params: PGLfloat); stdcall;
  1932.     glMinmax: procedure(target, internalformat: GLenum; sink: GLboolean); stdcall;
  1933.     glResetMinmax: procedure(target: GLenum); stdcall;
  1934.     glGetMinmax: procedure(target: GLenum; reset: GLboolean; format, Atype: GLenum; values: Pointer); stdcall;
  1935.     glGetMinmaxParameteriv: procedure(target, pname: GLenum; params: PGLint); stdcall;
  1936.     glGetMinmaxParameterfv: procedure(target, pname: GLenum; params: PGLfloat); stdcall;
  1937.  
  1938. //------------------------------------------------------------------------------
  1939.  
  1940.     // GL utility functions and procedures:
  1941.     gluErrorString : function(errCode: GLenum): PChar; stdcall;
  1942.     gluGetString : function(name: GLenum): PChar; stdcall;
  1943.     gluOrtho2D : procedure(left, right, bottom, top: GLdouble); stdcall;
  1944.     gluPerspective : procedure(fovy, aspect, zNear, zFar: GLdouble); stdcall;
  1945.     gluPickMatrix : procedure(x, y, width, height: GLdouble; viewport: TVector4i); stdcall;
  1946.     gluLookAt : procedure(eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz: GLdouble); stdcall;
  1947.     gluProject : function(objx, objy, objz: GLdouble; modelMatrix: TMatrix4d; projMatrix: TMatrix4d; viewport: TVector4i; winx, winy, winz: PGLdouble): GLint; stdcall;
  1948.     gluUnProject : function(winx, winy, winz: GLdouble; modelMatrix: TMatrix4d; projMatrix: TMatrix4d; viewport: TVector4i; objx, objy, objz: PGLdouble): GLint; stdcall;
  1949.     gluScaleImage : function(format: GLenum; widthin, heightin: GLint; typein: GLenum; datain: Pointer; widthout, heightout: GLint; typeout: GLenum; dataout: Pointer): GLint; stdcall;
  1950.     gluBuild1DMipmaps : function(target: GLenum; components, width: GLint; format, atype: GLenum; data: Pointer): GLint; stdcall;
  1951.     gluBuild2DMipmaps : function(target: GLenum; components, width, height: GLint; format, atype: GLenum; Data: Pointer): GLint; stdcall;
  1952.     gluNewQuadric : function : PGLUquadric; stdcall;
  1953.     gluDeleteQuadric : procedure(state: PGLUquadric); stdcall;
  1954.     gluQuadricNormals : procedure(quadObject: PGLUquadric; normals: GLenum); stdcall;
  1955.     gluQuadricTexture : procedure(quadObject: PGLUquadric; textureCoords: GLboolean); stdcall;
  1956.     gluQuadricOrientation : procedure(quadObject: PGLUquadric; orientation: GLenum); stdcall;
  1957.     gluQuadricDrawStyle : procedure(quadObject: PGLUquadric; drawStyle: GLenum); stdcall;
  1958.     gluCylinder : procedure(quadObject: PGLUquadric; baseRadius, topRadius, height: GLdouble; slices, stacks: GLint); stdcall;
  1959.     gluDisk : procedure(quadObject: PGLUquadric; innerRadius, outerRadius: GLdouble; slices, loops: GLint); stdcall; 
  1960.     gluPartialDisk : procedure(quadObject: PGLUquadric; innerRadius, outerRadius: GLdouble; slices, loops: GLint; startAngle, sweepAngle: GLdouble); stdcall;
  1961.     gluSphere : procedure(quadObject: PGLUquadric; radius: GLdouble; slices, stacks: GLint); stdcall;
  1962.     gluQuadricCallback : procedure(quadObject: PGLUquadric; which: GLenum; fn: TGLUQuadricErrorProc); stdcall;
  1963.     gluNewTess : function : PGLUtesselator; stdcall; 
  1964.     gluDeleteTess : procedure(tess: PGLUtesselator); stdcall;
  1965.     gluTessBeginPolygon : procedure(tess: PGLUtesselator; polygon_data: Pointer); stdcall;
  1966.     gluTessBeginContour : procedure(tess: PGLUtesselator); stdcall;
  1967.     gluTessVertex : procedure(tess: PGLUtesselator; coords: TVector3d; data: Pointer); stdcall;
  1968.     gluTessEndContour : procedure(tess: PGLUtesselator); stdcall;
  1969.     gluTessEndPolygon : procedure(tess: PGLUtesselator); stdcall;
  1970.     gluTessProperty : procedure(tess: PGLUtesselator; which: GLenum; value: GLdouble); stdcall;
  1971.     gluTessNormal : procedure(tess: PGLUtesselator; x, y, z: GLdouble); stdcall;
  1972.     gluTessCallback : procedure(tess: PGLUtesselator; which: GLenum; fn: Pointer); stdcall;
  1973.     gluGetTessProperty : procedure(tess: PGLUtesselator; which: GLenum; value: PGLdouble); stdcall;
  1974.     gluNewNurbsRenderer : function : PGLUnurbs; stdcall;
  1975.     gluDeleteNurbsRenderer : procedure(nobj: PGLUnurbs); stdcall;
  1976.     gluBeginSurface : procedure(nobj: PGLUnurbs); stdcall;
  1977.     gluBeginCurve : procedure(nobj: PGLUnurbs); stdcall;
  1978.     gluEndCurve : procedure(nobj: PGLUnurbs); stdcall;
  1979.     gluEndSurface : procedure(nobj: PGLUnurbs); stdcall;
  1980.     gluBeginTrim : procedure(nobj: PGLUnurbs); stdcall;
  1981.     gluEndTrim : procedure(nobj: PGLUnurbs); stdcall;
  1982.     gluPwlCurve : procedure(nobj: PGLUnurbs; count: GLint; points: PGLfloat; stride: GLint; atype: GLenum); stdcall;
  1983.     gluNurbsCurve : procedure(nobj: PGLUnurbs; nknots: GLint; knot: PGLfloat; stride: GLint; ctlarray: PGLfloat; order: GLint; atype: GLenum); stdcall;
  1984.     gluNurbsSurface : procedure(nobj: PGLUnurbs; sknot_count: GLint; sknot: PGLfloat; tknot_count: GLint; tknot: PGLfloat; s_stride, t_stride: GLint; ctlarray: PGLfloat; sorder, torder: GLint; atype: GLenum); stdcall;
  1985.     gluLoadSamplingMatrices : procedure(nobj: PGLUnurbs; modelMatrix, projMatrix: TMatrix4f; viewport: TVector4i); stdcall;
  1986.     gluNurbsProperty : procedure(nobj: PGLUnurbs; aproperty: GLenum; value: GLfloat); stdcall;
  1987.     gluGetNurbsProperty : procedure(nobj: PGLUnurbs; aproperty: GLenum; value: PGLfloat); stdcall;
  1988.     gluNurbsCallback : procedure(nobj: PGLUnurbs; which: GLenum; fn: TGLUNurbsErrorProc); stdcall;
  1989.     gluBeginPolygon : procedure(tess: PGLUtesselator); stdcall;
  1990.     gluNextContour : procedure(tess: PGLUtesselator; atype: GLenum); stdcall;
  1991.     gluEndPolygon : procedure(tess: PGLUtesselator); stdcall;
  1992.  
  1993. //------------------------------------------------------------------------------
  1994.  
  1995.     // window support functions
  1996.     wglCopyContext : function(RC1, RC2: HGLRC; p3: Cardinal): BOOL; stdcall;
  1997.     wglCreateContext : function(DC: HDC): HGLRC; stdcall;
  1998.     wglCreateLayerContext : function(DC: HDC; p2: Integer): HGLRC; stdcall;
  1999.     wglDeleteContext : function(RC: HGLRC): BOOL; stdcall;
  2000.     wglDescribeLayerPlane : function(p1: HDC; p2, p3: Integer; p4: Cardinal; p5: PLayerPlaneDescriptor): BOOL; stdcall;
  2001.     wglGetCurrentContext : function: HGLRC; stdcall;
  2002.     wglGetCurrentDC : function: HDC; stdcall;
  2003.     wglGetLayerPaletteEntries : function(p1: HDC; p2, p3, p4: Integer; pcr: Pointer): Integer; stdcall;
  2004.     wglGetProcAddress : function(ProcName: PChar): Pointer; stdcall;
  2005.     wglMakeCurrent : function(DC: HDC; p2: HGLRC): BOOL; stdcall;
  2006.     wglRealizeLayerPalette : function(p1: HDC; p2: Integer; p3: BOOL): BOOL; stdcall;
  2007.     wglSetLayerPaletteEntries : function(p1: HDC; p2, p3, p4: Integer; pcr: Pointer): Integer; stdcall;
  2008.     wglShareLists : function(p1, p2: HGLRC): BOOL; stdcall;
  2009.     wglSwapLayerBuffers : function(p1: HDC; p2: Cardinal): BOOL; stdcall;
  2010.     wglUseFontBitmapsA : function(DC: HDC; p2, p3, p4: DWORD): BOOL; stdcall;
  2011.     wglUseFontBitmapsW : function(DC: HDC; p2, p3, p4: DWORD): BOOL; stdcall;
  2012.     wglUseFontBitmaps : function(DC: HDC; p2, p3, p4: DWORD): BOOL; stdcall;
  2013.     wglUseFontOutlinesA : function(p1: HDC; p2, p3, p4: DWORD; p5, p6: Single; p7: Integer; p8: PGlyphMetricsFloat): BOOL; stdcall;
  2014.     wglUseFontOutlinesW : function(p1: HDC; p2, p3, p4: DWORD; p5, p6: Single; p7: Integer; p8: PGlyphMetricsFloat): BOOL; stdcall;
  2015.     wglUseFontOutlines : function(p1: HDC; p2, p3, p4: DWORD; p5, p6: Single; p7: Integer; p8: PGlyphMetricsFloat): BOOL; stdcall;
  2016.     ChoosePixelFormat : function(DC: HDC; PFD: PPixelFormatDescriptor): Integer; stdcall;
  2017.     DescribePixelFormat : function(DC: HDC; p2: Integer; p3: UINT; PFD: PPixelFormatDescriptor): Integer; stdcall;
  2018.     GetPixelFormat : function(DC: HDC): Integer; stdcall;
  2019.     SetPixelFormat : function(DC: HDC; p2: Integer; PFD: PPixelFormatDescriptor): BOOL; stdcall;
  2020.     SwapBuffers : function(DC: HDC): BOOL; stdcall;
  2021.  
  2022. //------------------------------------------------------------------------------
  2023.  
  2024.     // Extension functions
  2025.     glAddSwapHintRectWIN : procedure(x, y: GLint; width, height: GLsizei);
  2026.     glAreTexturesResidentEXT : function(n: GLsizei; textures: PGLuint; residences: PGLBoolean): GLBoolean; stdcall;
  2027.     glArrayElementEXT : procedure(i: GLint); stdcall;
  2028.     glArrayElementArrayEXT : procedure(mode: GLenum; count: GLsizei; pi: Pointer); stdcall;
  2029.     glBeginSceneEXT : procedure; stdcall;
  2030.     glBindTextureEXT : procedure(target: GLenum; texture: GLuint); stdcall;
  2031.     glColorPointerEXT : procedure(size: GLint; atype: GLenum; stride, count: GLsizei; data: pointer); stdcall;
  2032.     glColorTableEXT : procedure(target, internalFormat: GLenum; width: GLsizei; format, atype: GLenum; data: Pointer); stdcall;
  2033.     glColorSubTableExt : procedure(target: GLenum; start, count: GLsizei; format, atype: GLenum; data: Pointer); stdcall;
  2034.     glCopyTexImage1DEXT : procedure(target: GLenum; level: GLint; internalFormat: GLenum; x, y: GLint; width: GLsizei; border: GLint); stdcall;
  2035.     glCopyTexSubImage1DEXT : procedure(target: GLenum; level, xoffset, x, y: GLint; width: GLsizei); stdcall;
  2036.     glCopyTexImage2DEXT : procedure(target: GLenum; level: GLint; internalFormat: GLenum; x, y: GLint; width, height: GLsizei; border: GLint); stdcall;
  2037.     glCopyTexSubImage2DEXT : procedure(target: GLenum; level, xoffset, yoffset, x, y: GLint; width, height: GLsizei); stdcall;
  2038.     glCopyTexSubImage3DEXT : procedure(target: GLenum; level, xoffset, yoffset, zoffset, x, y: GLint; width, height: GLsizei); stdcall;
  2039.     glCullParameterfvEXT : procedure(pname: GLenum; params: PGLfloat); stdcall;
  2040.     glCullParameterdvEXT : procedure(pname: GLenum; params: PGLdouble); stdcall;
  2041.     glDeleteTexturesEXT : procedure(n: GLsizei; textures: PGLuint); stdcall;
  2042.     glDrawArraysEXT : procedure(mode: GLenum; first: GLint; count: GLsizei); stdcall;
  2043.     glEdgeFlagPointerEXT : procedure(stride, count: GLsizei; data: PGLboolean); stdcall;
  2044.     glEndSceneEXT : procedure; stdcall;
  2045.     glGenTexturesEXT : procedure(n: GLsizei; textures: PGLuint); stdcall;
  2046.     glGetColorTableEXT : procedure(target, format, atype: GLenum; data: Pointer); stdcall;
  2047.     glGetColorTablePameterfvEXT : procedure(target, pname: GLenum; params: Pointer); stdcall;
  2048.     glGetColorTablePameterivEXT : procedure(target, pname: GLenum; params: Pointer); stdcall;
  2049.     glGetPointervEXT : procedure(pname: GLenum; params: Pointer); stdcall;
  2050.     glIndexFuncEXT : procedure(func: GLenum; ref: GLfloat); stdcall;
  2051.     glIndexMaterialEXT : procedure(face: GLenum; mode: GLenum); stdcall;
  2052.     glIndexPointerEXT : procedure(atype: GLenum; stride, count: GLsizei; data: pointer); stdcall;
  2053.     glIsTextureEXT : function(texture: GLuint): GLBoolean; stdcall;
  2054.     glLockArraysEXT : procedure(first: GLint; count: GLsizei); stdcall;
  2055.     glNormalPointerEXT : procedure(atype: GLenum; stride, count: GLsizei; data: pointer); stdcall;
  2056.     glPolygonOffsetEXT: procedure(factor, bias: GLfloat); stdcall;
  2057.     glPrioritizeTexturesEXT : procedure(n: GLsizei; textures: PGLuint; priorities: PGLclampf); stdcall;
  2058.     glTexCoordPointerEXT : procedure(size: GLint; atype: GLenum; stride, count: GLsizei; data: pointer); stdcall;
  2059.     glTexSubImage1DEXT : procedure(target: GLenum; level, xoffset: GLint; width: GLsizei; format, Atype: GLenum; pixels: Pointer); stdcall;
  2060.     glTexSubImage2DEXT : procedure(target: GLenum; level, xoffset, yoffset: GLint; width, height: GLsizei; format, Atype: GLenum; pixels: Pointer); stdcall;
  2061.     glTexSubImage3DEXT : procedure(target: GLenum; level, xoffset, yoffset, zoffset: GLint; width, height, depth: GLsizei; format, Atype: GLenum; pixels: Pointer); stdcall;
  2062.     glUnlockArraysEXT : procedure; stdcall;
  2063.     glVertexPointerExt : procedure(size: GLint; atype: GLenum; stride, count: GLsizei; data: pointer); stdcall;
  2064.  
  2065.     gluNurbsCallbackDataEXT : procedure(nurb: PGLUnurbs; userData: Pointer); stdcall;
  2066.     gluNewNurbsTessellatorEXT : function: PGLUnurbs; stdcall;
  2067.     gluDeleteNurbsTessellatorEXT : procedure(nurb: PGLUnurbs); stdcall;
  2068.  
  2069. //------------------------------------------------------------------------------
  2070.  
  2071. procedure CloseOpenGL;
  2072. function InitOpenGL: Boolean;
  2073. function InitOpenGLFromLibrary(GL_Name, GLU_Name: String): Boolean;
  2074.  
  2075. procedure ClearExtensions;
  2076. procedure ActivateRenderingContext(DC: HDC; RC: HGLRC);
  2077. function  CreateRenderingContext(DC: HDC; Options: TRCOptions; ColorDepth: Integer; StencilBits: Byte): HGLRC;
  2078. procedure DeactivateRenderingContext;
  2079. procedure DestroyRenderingContext(RC: HGLRC);
  2080. procedure ReadExtensions;
  2081. procedure ReadImplementationProperties;
  2082.  
  2083. //------------------------------------------------------------------------------
  2084.  
  2085. implementation
  2086.  
  2087. uses SysUtils;
  2088.  
  2089. {$IFDEF VER100} {$J+} {$ENDIF}
  2090.  
  2091. const FirstContext    : Boolean = True;
  2092.       LastPixelFormat : Integer = 0;
  2093.  
  2094. {$IFDEF VER100} {$J-} {$ENDIF}
  2095.  
  2096. var GLHandle, GLUHandle : HINST;
  2097.  
  2098. //------------------------------------------------------------------------------
  2099.  
  2100. procedure ClearProcAddresses;
  2101.  
  2102. begin
  2103.   glAccum:=nil;
  2104.   glAlphaFunc:=nil;
  2105.   glAreTexturesResident:=nil;
  2106.   glArrayElement:=nil;
  2107.   glBegin:=nil;
  2108.   glBindTexture:=nil;
  2109.   glBitmap:=nil;
  2110.   glBlendFunc:=nil;
  2111.   glCallList:=nil;
  2112.   glCallLists:=nil;
  2113.   glClear:=nil;
  2114.   glClearAccum:=nil;
  2115.   glClearColor:=nil;
  2116.   glClearDepth:=nil;
  2117.   glClearIndex:=nil;
  2118.   glClearStencil:=nil;
  2119.   glClipPlane:=nil;
  2120.   glColor3b:=nil;
  2121.   glColor3bv:=nil;
  2122.   glColor3d:=nil;
  2123.   glColor3dv:=nil;
  2124.   glColor3f:=nil;
  2125.   glColor3fv:=nil;
  2126.   glColor3i:=nil;
  2127.   glColor3iv:=nil;
  2128.   glColor3s:=nil;
  2129.   glColor3sv:=nil;
  2130.   glColor3ub:=nil;
  2131.   glColor3ubv:=nil;
  2132.   glColor3ui:=nil;
  2133.   glColor3uiv:=nil;
  2134.   glColor3us:=nil;
  2135.   glColor3usv:=nil;
  2136.   glColor4b:=nil;
  2137.   glColor4bv:=nil;
  2138.   glColor4d:=nil;
  2139.   glColor4dv:=nil;
  2140.   glColor4f:=nil;
  2141.   glColor4fv:=nil;
  2142.   glColor4i:=nil;
  2143.   glColor4iv:=nil;
  2144.   glColor4s:=nil;
  2145.   glColor4sv:=nil;
  2146.   glColor4ub:=nil;
  2147.   glColor4ubv:=nil;
  2148.   glColor4ui:=nil;
  2149.   glColor4uiv:=nil;
  2150.   glColor4us:=nil;
  2151.   glColor4usv:=nil;
  2152.   glColorMask:=nil;
  2153.   glColorMaterial:=nil;
  2154.   glColorPointer:=nil;
  2155.   glCopyPixels:=nil;                   
  2156.   glCopyTexImage1D:=nil;               
  2157.   glCopyTexImage2D:=nil;               
  2158.   glCopyTexSubImage1D:=nil;            
  2159.   glCopyTexSubImage2D:=nil;            
  2160.   glCullFace:=nil;                     
  2161.   glDeleteLists:=nil;                  
  2162.   glDeleteTextures:=nil;               
  2163.   glDepthFunc:=nil;                    
  2164.   glDepthMask:=nil;                    
  2165.   glDepthRange:=nil;                   
  2166.   glDisable:=nil;                      
  2167.   glDisableClientState:=nil;           
  2168.   glDrawArrays:=nil;                   
  2169.   glDrawBuffer:=nil;                   
  2170.   glDrawElements:=nil;                 
  2171.   glDrawPixels:=nil;                   
  2172.   glEdgeFlag:=nil;                     
  2173.   glEdgeFlagPointer:=nil;              
  2174.   glEdgeFlagv:=nil;                    
  2175.   glEnable:=nil;                       
  2176.   glEnableClientState:=nil;
  2177.   glEnd:=nil;                          
  2178.   glEndList:=nil;                      
  2179.   glEvalCoord1d:=nil;                  
  2180.   glEvalCoord1dv:=nil;
  2181.   glEvalCoord1f:=nil;                  
  2182.   glEvalCoord1fv:=nil;                 
  2183.   glEvalCoord2d:=nil;                  
  2184.   glEvalCoord2dv:=nil;                 
  2185.   glEvalCoord2f:=nil;                  
  2186.   glEvalCoord2fv:=nil;
  2187.   glEvalMesh1:=nil;                    
  2188.   glEvalMesh2:=nil;                    
  2189.   glEvalPoint1:=nil;                   
  2190.   glEvalPoint2:=nil;                   
  2191.   glFeedbackBuffer:=nil;               
  2192.   glFinish:=nil;                       
  2193.   glFlush:=nil;                        
  2194.   glFogf:=nil;                         
  2195.   glFogfv:=nil;                        
  2196.   glFogi:=nil;                         
  2197.   glFogiv:=nil;                        
  2198.   glFrontFace:=nil;                    
  2199.   glFrustum:=nil;                      
  2200.   glGenLists:=nil;                     
  2201.   glGenTextures:=nil;                  
  2202.   glGetBooleanv:=nil;                  
  2203.   glGetClipPlane:=nil;                 
  2204.   glGetDoublev:=nil;                   
  2205.   glGetError:=nil;                     
  2206.   glGetFloatv:=nil;                    
  2207.   glGetIntegerv:=nil;                  
  2208.   glGetLightfv:=nil;                   
  2209.   glGetLightiv:=nil;                   
  2210.   glGetMapdv:=nil;                     
  2211.   glGetMapfv:=nil;                     
  2212.   glGetMapiv:=nil;
  2213.   glGetMaterialfv:=nil;                
  2214.   glGetMaterialiv:=nil;                
  2215.   glGetPixelMapfv:=nil;                
  2216.   glGetPixelMapuiv:=nil;
  2217.   glGetPixelMapusv:=nil;               
  2218.   glGetPointerv:=nil;                  
  2219.   glGetPolygonStipple:=nil;
  2220.   glGetString:=nil;                    
  2221.   glGetTexEnvfv:=nil;                  
  2222.   glGetTexEnviv:=nil;                  
  2223.   glGetTexGendv:=nil;                  
  2224.   glGetTexGenfv:=nil;                  
  2225.   glGetTexGeniv:=nil;                  
  2226.   glGetTexImage:=nil;                  
  2227.   glGetTexLevelParameterfv:=nil;       
  2228.   glGetTexLevelParameteriv:=nil;       
  2229.   glGetTexParameterfv:=nil;            
  2230.   glGetTexParameteriv:=nil;            
  2231.   glHint:=nil;                         
  2232.   glIndexMask:=nil;                    
  2233.   glIndexPointer:=nil;                 
  2234.   glIndexd:=nil;                       
  2235.   glIndexdv:=nil;                      
  2236.   glIndexf:=nil;                       
  2237.   glIndexfv:=nil;                      
  2238.   glIndexi:=nil;                       
  2239.   glIndexiv:=nil;                      
  2240.   glIndexs:=nil;                       
  2241.   glIndexsv:=nil;                      
  2242.   glIndexub:=nil;                      
  2243.   glIndexubv:=nil;                     
  2244.   glInitNames:=nil;                    
  2245.   glInterleavedArrays:=nil;            
  2246.   glIsEnabled:=nil;                    
  2247.   glIsList:=nil;                       
  2248.   glIsTexture:=nil;
  2249.   glLightModelf:=nil;                  
  2250.   glLightModelfv:=nil;                 
  2251.   glLightModeli:=nil;                  
  2252.   glLightModeliv:=nil;
  2253.   glLightf:=nil;                       
  2254.   glLightfv:=nil;                      
  2255.   glLighti:=nil;                       
  2256.   glLightiv:=nil;                      
  2257.   glLineStipple:=nil;                  
  2258.   glLineWidth:=nil;                    
  2259.   glListBase:=nil;                     
  2260.   glLoadIdentity:=nil;                 
  2261.   glLoadMatrixd:=nil;                  
  2262.   glLoadMatrixf:=nil;                  
  2263.   glLoadName:=nil;                     
  2264.   glLogicOp:=nil;                      
  2265.   glMap1d:=nil;                        
  2266.   glMap1f:=nil;                        
  2267.   glMap2d:=nil;                        
  2268.   glMap2f:=nil;                        
  2269.   glMapGrid1d:=nil;                    
  2270.   glMapGrid1f:=nil;                    
  2271.   glMapGrid2d:=nil;                    
  2272.   glMapGrid2f:=nil;                    
  2273.   glMaterialf:=nil;                    
  2274.   glMaterialfv:=nil;                   
  2275.   glMateriali:=nil;                    
  2276.   glMaterialiv:=nil;                   
  2277.   glMatrixMode:=nil;                   
  2278.   glMultMatrixd:=nil;                  
  2279.   glMultMatrixf:=nil;                  
  2280.   glNewList:=nil;                      
  2281.   glNormal3b:=nil;                     
  2282.   glNormal3bv:=nil;                    
  2283.   glNormal3d:=nil;                     
  2284.   glNormal3dv:=nil;
  2285.   glNormal3f:=nil;
  2286.   glNormal3fv:=nil;                    
  2287.   glNormal3i:=nil;                     
  2288.   glNormal3iv:=nil;
  2289.   glNormal3s:=nil;                     
  2290.   glNormal3sv:=nil;                    
  2291.   glNormalPointer:=nil;                
  2292.   glOrtho:=nil;                        
  2293.   glPassThrough:=nil;                  
  2294.   glPixelMapfv:=nil;                   
  2295.   glPixelMapuiv:=nil;                  
  2296.   glPixelMapusv:=nil;                  
  2297.   glPixelStoref:=nil;                  
  2298.   glPixelStorei:=nil;                  
  2299.   glPixelTransferf:=nil;               
  2300.   glPixelTransferi:=nil;               
  2301.   glPixelZoom:=nil;                    
  2302.   glPointSize:=nil;                    
  2303.   glPolygonMode:=nil;                  
  2304.   glPolygonOffset:=nil;                
  2305.   glPolygonStipple:=nil;               
  2306.   glPopAttrib:=nil;                    
  2307.   glPopClientAttrib:=nil;              
  2308.   glPopMatrix:=nil;                    
  2309.   glPopName:=nil;                      
  2310.   glPrioritizeTextures:=nil;           
  2311.   glPushAttrib:=nil;                   
  2312.   glPushClientAttrib:=nil;             
  2313.   glPushMatrix:=nil;                   
  2314.   glPushName:=nil;                     
  2315.   glRasterPos2d:=nil;                  
  2316.   glRasterPos2dv:=nil;                 
  2317.   glRasterPos2f:=nil;                  
  2318.   glRasterPos2fv:=nil;
  2319.   glRasterPos2i:=nil;                  
  2320.   glRasterPos2iv:=nil;
  2321.   glRasterPos2s:=nil;                  
  2322.   glRasterPos2sv:=nil;                 
  2323.   glRasterPos3d:=nil;                  
  2324.   glRasterPos3dv:=nil;
  2325.   glRasterPos3f:=nil;                  
  2326.   glRasterPos3fv:=nil;                 
  2327.   glRasterPos3i:=nil;                  
  2328.   glRasterPos3iv:=nil;                 
  2329.   glRasterPos3s:=nil;                  
  2330.   glRasterPos3sv:=nil;                 
  2331.   glRasterPos4d:=nil;                  
  2332.   glRasterPos4dv:=nil;                 
  2333.   glRasterPos4f:=nil;                  
  2334.   glRasterPos4fv:=nil;                 
  2335.   glRasterPos4i:=nil;                  
  2336.   glRasterPos4iv:=nil;                 
  2337.   glRasterPos4s:=nil;                  
  2338.   glRasterPos4sv:=nil;                 
  2339.   glReadBuffer:=nil;                   
  2340.   glReadPixels:=nil;                   
  2341.   glRectd:=nil;                        
  2342.   glRectdv:=nil;                       
  2343.   glRectf:=nil;                        
  2344.   glRectfv:=nil;                       
  2345.   glRecti:=nil;                        
  2346.   glRectiv:=nil;                       
  2347.   glRects:=nil;                        
  2348.   glRectsv:=nil;                       
  2349.   glRenderMode:=nil;                   
  2350.   glRotated:=nil;                      
  2351.   glRotatef:=nil;
  2352.   glScaled:=nil;                       
  2353.   glScalef:=nil;                       
  2354.   glScissor:=nil;                      
  2355.   glSelectBuffer:=nil;                 
  2356.   glShadeModel:=nil;
  2357.   glStencilFunc:=nil;                  
  2358.   glStencilMask:=nil;                  
  2359.   glStencilOp:=nil;                    
  2360.   glTexCoord1d:=nil;
  2361.   glTexCoord1dv:=nil;                  
  2362.   glTexCoord1f:=nil;                   
  2363.   glTexCoord1fv:=nil;                  
  2364.   glTexCoord1i:=nil;                   
  2365.   glTexCoord1iv:=nil;                  
  2366.   glTexCoord1s:=nil;                   
  2367.   glTexCoord1sv:=nil;                  
  2368.   glTexCoord2d:=nil;                   
  2369.   glTexCoord2dv:=nil;                  
  2370.   glTexCoord2f:=nil;                   
  2371.   glTexCoord2fv:=nil;                  
  2372.   glTexCoord2i:=nil;                   
  2373.   glTexCoord2iv:=nil;                  
  2374.   glTexCoord2s:=nil;                   
  2375.   glTexCoord2sv:=nil;                  
  2376.   glTexCoord3d:=nil;                   
  2377.   glTexCoord3dv:=nil;                  
  2378.   glTexCoord3f:=nil;                   
  2379.   glTexCoord3fv:=nil;                  
  2380.   glTexCoord3i:=nil;                   
  2381.   glTexCoord3iv:=nil;                  
  2382.   glTexCoord3s:=nil;                   
  2383.   glTexCoord3sv:=nil;                  
  2384.   glTexCoord4d:=nil;
  2385.   glTexCoord4dv:=nil;                  
  2386.   glTexCoord4f:=nil;                   
  2387.   glTexCoord4fv:=nil;                  
  2388.   glTexCoord4i:=nil;                   
  2389.   glTexCoord4iv:=nil;                  
  2390.   glTexCoord4s:=nil;                   
  2391.   glTexCoord4sv:=nil;                  
  2392.   glTexCoordPointer:=nil;
  2393.   glTexEnvf:=nil;                      
  2394.   glTexEnvfv:=nil;                     
  2395.   glTexEnvi:=nil;                      
  2396.   glTexEnviv:=nil;
  2397.   glTexGend:=nil;                      
  2398.   glTexGendv:=nil;                     
  2399.   glTexGenf:=nil;                      
  2400.   glTexGenfv:=nil;                     
  2401.   glTexGeni:=nil;                      
  2402.   glTexGeniv:=nil;                     
  2403.   glTexImage1D:=nil;                   
  2404.   glTexImage2D:=nil;                   
  2405.   glTexParameterf:=nil;                
  2406.   glTexParameterfv:=nil;               
  2407.   glTexParameteri:=nil;                
  2408.   glTexParameteriv:=nil;               
  2409.   glTexSubImage1D:=nil;                
  2410.   glTexSubImage2D:=nil;                
  2411.   glTranslated:=nil;                   
  2412.   glTranslatef:=nil;
  2413.   glVertex2d:=nil;                     
  2414.   glVertex2dv:=nil;                    
  2415.   glVertex2f:=nil;                     
  2416.   glVertex2fv:=nil;                    
  2417.   glVertex2i:=nil;
  2418.   glVertex2iv:=nil;                    
  2419.   glVertex2s:=nil;                     
  2420.   glVertex2sv:=nil;                    
  2421.   glVertex3d:=nil;
  2422.   glVertex3dv:=nil;                    
  2423.   glVertex3f:=nil;                     
  2424.   glVertex3fv:=nil;                    
  2425.   glVertex3i:=nil;                     
  2426.   glVertex3iv:=nil;                    
  2427.   glVertex3s:=nil;                     
  2428.   glVertex3sv:=nil;
  2429.   glVertex4d:=nil;                     
  2430.   glVertex4dv:=nil;                    
  2431.   glVertex4f:=nil;                     
  2432.   glVertex4fv:=nil;
  2433.   glVertex4i:=nil;                     
  2434.   glVertex4iv:=nil;                    
  2435.   glVertex4s:=nil;                     
  2436.   glVertex4sv:=nil;                    
  2437.   glVertexPointer:=nil;                
  2438.   glViewport:=nil;
  2439.   wglCopyContext:=nil;
  2440.   wglCreateContext:=nil;
  2441.   wglCreateLayerContext:=nil;
  2442.   wglDeleteContext:=nil;
  2443.   wglGetCurrentContext:=nil;
  2444.   wglGetCurrentDC:=nil;
  2445.   wglGetProcAddress:=nil;
  2446.   wglMakeCurrent:=nil;
  2447.   wglShareLists:=nil;
  2448.   wglUseFontBitmapsA:=nil;
  2449.   wglUseFontBitmapsW:=nil;
  2450.   wglUseFontBitmaps:=nil;
  2451.   wglUseFontOutlinesA:=nil;
  2452.   wglUseFontOutlinesW:=nil;
  2453.   wglUseFontOutlines:=nil;
  2454.   wglDescribeLayerPlane:=nil;
  2455.   wglSetLayerPaletteEntries:=nil;
  2456.   wglGetLayerPaletteEntries:=nil;
  2457.   wglRealizeLayerPalette:=nil;
  2458.   wglSwapLayerBuffers:=nil;
  2459.  
  2460.   SwapBuffers:=nil;
  2461.   ChoosePixelFormat:=nil;
  2462.   GetPixelFormat:=nil;
  2463.   SetPixelFormat:=nil;
  2464.   DescribePixelFormat:=nil;
  2465.  
  2466.   // GL 1.2
  2467.   glDrawRangeElements:=nil;
  2468.   glTexImage3D:=nil;
  2469.   // GL 1.2 ARB imaging
  2470.   glBlendColor:=nil;
  2471.   glBlendEquation:=nil;
  2472.   glColorSubTable:=nil;
  2473.   glCopyColorSubTable:=nil;
  2474.   glColorTable:=nil;
  2475.   glCopyColorTable:=nil;
  2476.   glColorTableParameteriv:=nil;
  2477.   glColorTableParameterfv:=nil;
  2478.   glGetColorTable:=nil;
  2479.   glGetColorTableParameteriv:=nil;
  2480.   glGetColorTableParameterfv:=nil;
  2481.   glConvolutionFilter1D:=nil;
  2482.   glConvolutionFilter2D:=nil;
  2483.   glCopyConvolutionFilter1D:=nil;
  2484.   glCopyConvolutionFilter2D:=nil;
  2485.   glGetConvolutionFilter:=nil;
  2486.   glSeparableFilter2D:=nil;
  2487.   glGetSeparableFilter:=nil;
  2488.   glConvolutionParameteri:=nil;
  2489.   glConvolutionParameteriv:=nil;
  2490.   glConvolutionParameterf:=nil;
  2491.   glConvolutionParameterfv:=nil;
  2492.   glGetConvolutionParameteriv:=nil;
  2493.   glGetConvolutionParameterfv:=nil;
  2494.   glHistogram:=nil;
  2495.   glResetHistogram:=nil;
  2496.   glGetHistogram:=nil;
  2497.   glGetHistogramParameteriv:=nil;
  2498.   glGetHistogramParameterfv:=nil;
  2499.   glMinmax:=nil;
  2500.   glResetMinmax:=nil;
  2501.   glGetMinmax:=nil;
  2502.   glGetMinmaxParameteriv:=nil;
  2503.   glGetMinmaxParameterfv:=nil;
  2504. end;
  2505.  
  2506. //------------------------------------------------------------------------------
  2507.  
  2508. procedure LoadProcAddresses;
  2509.  
  2510. begin
  2511.   if GLHandle > 0 then
  2512.   begin
  2513.     glAccum:=GetProcAddress(GLHandle,'glAccum');
  2514.     glAlphaFunc:=GetProcAddress(GLHandle,'glAlphaFunc');
  2515.     glAreTexturesResident:=GetProcAddress(GLHandle,'glAreTexturesResident');
  2516.     glArrayElement:=GetProcAddress(GLHandle,'glArrayElement');
  2517.     glBegin:=GetProcAddress(GLHandle,'glBegin');
  2518.     glBindTexture:=GetProcAddress(GLHandle,'glBindTexture');
  2519.     glBitmap:=GetProcAddress(GLHandle,'glBitmap');
  2520.     glBlendFunc:=GetProcAddress(GLHandle,'glBlendFunc');
  2521.     glCallList:=GetProcAddress(GLHandle,'glCallList');
  2522.     glCallLists:=GetProcAddress(GLHandle,'glCallLists');
  2523.     glClear:=GetProcAddress(GLHandle,'glClear');
  2524.     glClearAccum:=GetProcAddress(GLHandle,'glClearAccum');
  2525.     glClearColor:=GetProcAddress(GLHandle,'glClearColor');
  2526.     glClearDepth:=GetProcAddress(GLHandle,'glClearDepth');
  2527.     glClearIndex:=GetProcAddress(GLHandle,'glClearIndex');
  2528.     glClearStencil:=GetProcAddress(GLHandle,'glClearStencil');
  2529.     glClipPlane:=GetProcAddress(GLHandle,'glClipPlane');
  2530.     glColor3b:=GetProcAddress(GLHandle,'glColor3b');
  2531.     glColor3bv:=GetProcAddress(GLHandle,'glColor3bv');
  2532.     glColor3d:=GetProcAddress(GLHandle,'glColor3d');
  2533.     glColor3dv:=GetProcAddress(GLHandle,'glColor3dv');
  2534.     glColor3f:=GetProcAddress(GLHandle,'glColor3f');
  2535.     glColor3fv:=GetProcAddress(GLHandle,'glColor3fv');
  2536.     glColor3i:=GetProcAddress(GLHandle,'glColor3i');
  2537.     glColor3iv:=GetProcAddress(GLHandle,'glColor3iv');
  2538.     glColor3s:=GetProcAddress(GLHandle,'glColor3s');
  2539.     glColor3sv:=GetProcAddress(GLHandle,'glColor3sv');
  2540.     glColor3ub:=GetProcAddress(GLHandle,'glColor3ub');
  2541.     glColor3ubv:=GetProcAddress(GLHandle,'glColor3ubv');
  2542.     glColor3ui:=GetProcAddress(GLHandle,'glColor3ui');
  2543.     glColor3uiv:=GetProcAddress(GLHandle,'glColor3uiv');
  2544.     glColor3us:=GetProcAddress(GLHandle,'glColor3us');
  2545.     glColor3usv:=GetProcAddress(GLHandle,'glColor3usv');
  2546.     glColor4b:=GetProcAddress(GLHandle,'glColor4b');
  2547.     glColor4bv:=GetProcAddress(GLHandle,'glColor4bv');
  2548.     glColor4d:=GetProcAddress(GLHandle,'glColor4d');
  2549.     glColor4dv:=GetProcAddress(GLHandle,'glColor4dv');
  2550.     glColor4f:=GetProcAddress(GLHandle,'glColor4f');
  2551.     glColor4fv:=GetProcAddress(GLHandle,'glColor4fv');
  2552.     glColor4i:=GetProcAddress(GLHandle,'glColor4i');
  2553.     glColor4iv:=GetProcAddress(GLHandle,'glColor4iv');
  2554.     glColor4s:=GetProcAddress(GLHandle,'glColor4s');
  2555.     glColor4sv:=GetProcAddress(GLHandle,'glColor4sv');
  2556.     glColor4ub:=GetProcAddress(GLHandle,'glColor4ub');
  2557.     glColor4ubv:=GetProcAddress(GLHandle,'glColor4ubv');
  2558.     glColor4ui:=GetProcAddress(GLHandle,'glColor4ui');
  2559.     glColor4uiv:=GetProcAddress(GLHandle,'glColor4uiv');
  2560.     glColor4us:=GetProcAddress(GLHandle,'glColor4us');
  2561.     glColor4usv:=GetProcAddress(GLHandle,'glColor4usv');
  2562.     glColorMask:=GetProcAddress(GLHandle,'glColorMask');
  2563.     glColorMaterial:=GetProcAddress(GLHandle,'glColorMaterial');
  2564.     glColorPointer:=GetProcAddress(GLHandle,'glColorPointer');
  2565.     glCopyPixels:=GetProcAddress(GLHandle,'glCopyPixels');
  2566.     glCopyTexImage1D:=GetProcAddress(GLHandle,'glCopyTexImage1D');
  2567.     glCopyTexImage2D:=GetProcAddress(GLHandle,'glCopyTexImage2D');
  2568.     glCopyTexSubImage1D:=GetProcAddress(GLHandle,'glCopyTexSubImage1D');
  2569.     glCopyTexSubImage2D:=GetProcAddress(GLHandle,'glCopyTexSubImage2D');
  2570.     glCullFace:=GetProcAddress(GLHandle,'glCullFace');
  2571.     glDeleteLists:=GetProcAddress(GLHandle,'glDeleteLists');
  2572.     glDeleteTextures:=GetProcAddress(GLHandle,'glDeleteTextures');
  2573.     glDepthFunc:=GetProcAddress(GLHandle,'glDepthFunc');
  2574.     glDepthMask:=GetProcAddress(GLHandle,'glDepthMask');
  2575.     glDepthRange:=GetProcAddress(GLHandle,'glDepthRange');
  2576.     glDisable:=GetProcAddress(GLHandle,'glDisable');
  2577.     glDisableClientState:=GetProcAddress(GLHandle,'glDisableClientState');
  2578.     glDrawArrays:=GetProcAddress(GLHandle,'glDrawArrays');
  2579.     glDrawBuffer:=GetProcAddress(GLHandle,'glDrawBuffer');
  2580.     glDrawElements:=GetProcAddress(GLHandle,'glDrawElements');
  2581.     glDrawPixels:=GetProcAddress(GLHandle,'glDrawPixels');
  2582.     glEdgeFlag:=GetProcAddress(GLHandle,'glEdgeFlag');
  2583.     glEdgeFlagPointer:=GetProcAddress(GLHandle,'glEdgeFlagPointer');
  2584.     glEdgeFlagv:=GetProcAddress(GLHandle,'glEdgeFlagv');
  2585.     glEnable:=GetProcAddress(GLHandle,'glEnable');
  2586.     glEnableClientState:=GetProcAddress(GLHandle,'glEnableClientState');
  2587.     glEnd:=GetProcAddress(GLHandle,'glEnd');
  2588.     glEndList:=GetProcAddress(GLHandle,'glEndList');
  2589.     glEvalCoord1d:=GetProcAddress(GLHandle,'glEvalCoord1d');
  2590.     glEvalCoord1dv:=GetProcAddress(GLHandle,'glEvalCoord1dv');
  2591.     glEvalCoord1f:=GetProcAddress(GLHandle,'glEvalCoord1f');
  2592.     glEvalCoord1fv:=GetProcAddress(GLHandle,'glEvalCoord1fv');
  2593.     glEvalCoord2d:=GetProcAddress(GLHandle,'glEvalCoord2d');
  2594.     glEvalCoord2dv:=GetProcAddress(GLHandle,'glEvalCoord2dv');
  2595.     glEvalCoord2f:=GetProcAddress(GLHandle,'glEvalCoord2f');
  2596.     glEvalCoord2fv:=GetProcAddress(GLHandle,'glEvalCoord2fv');
  2597.     glEvalMesh1:=GetProcAddress(GLHandle,'glEvalMesh1');
  2598.     glEvalMesh2:=GetProcAddress(GLHandle,'glEvalMesh2');
  2599.     glEvalPoint1:=GetProcAddress(GLHandle,'glEvalPoint1');
  2600.     glEvalPoint2:=GetProcAddress(GLHandle,'glEvalPoint2');
  2601.     glFeedbackBuffer:=GetProcAddress(GLHandle,'glFeedbackBuffer');
  2602.     glFinish:=GetProcAddress(GLHandle,'glFinish');
  2603.     glFlush:=GetProcAddress(GLHandle,'glFlush');
  2604.     glFogf:=GetProcAddress(GLHandle,'glFogf');
  2605.     glFogfv:=GetProcAddress(GLHandle,'glFogfv');
  2606.     glFogi:=GetProcAddress(GLHandle,'glFogi');
  2607.     glFogiv:=GetProcAddress(GLHandle,'glFogiv');
  2608.     glFrontFace:=GetProcAddress(GLHandle,'glFrontFace');
  2609.     glFrustum:=GetProcAddress(GLHandle,'glFrustum');
  2610.     glGenLists:=GetProcAddress(GLHandle,'glGenLists');
  2611.     glGenTextures:=GetProcAddress(GLHandle,'glGenTextures');
  2612.     glGetBooleanv:=GetProcAddress(GLHandle,'glGetBooleanv');
  2613.     glGetClipPlane:=GetProcAddress(GLHandle,'glGetClipPlane');
  2614.     glGetDoublev:=GetProcAddress(GLHandle,'glGetDoublev');
  2615.     glGetError:=GetProcAddress(GLHandle,'glGetError');
  2616.     glGetFloatv:=GetProcAddress(GLHandle,'glGetFloatv');
  2617.     glGetIntegerv:=GetProcAddress(GLHandle,'glGetIntegerv');
  2618.     glGetLightfv:=GetProcAddress(GLHandle,'glGetLightfv');
  2619.     glGetLightiv:=GetProcAddress(GLHandle,'glGetLightiv');
  2620.     glGetMapdv:=GetProcAddress(GLHandle,'glGetMapdv');
  2621.     glGetMapfv:=GetProcAddress(GLHandle,'glGetMapfv');
  2622.     glGetMapiv:=GetProcAddress(GLHandle,'glGetMapiv');
  2623.     glGetMaterialfv:=GetProcAddress(GLHandle,'glGetMaterialfv');
  2624.     glGetMaterialiv:=GetProcAddress(GLHandle,'glGetMaterialiv');
  2625.     glGetPixelMapfv:=GetProcAddress(GLHandle,'glGetPixelMapfv');
  2626.     glGetPixelMapuiv:=GetProcAddress(GLHandle,'glGetPixelMapuiv');
  2627.     glGetPixelMapusv:=GetProcAddress(GLHandle,'glGetPixelMapusv');
  2628.     glGetPointerv:=GetProcAddress(GLHandle,'glGetPointerv');
  2629.     glGetPolygonStipple:=GetProcAddress(GLHandle,'glGetPolygonStipple');
  2630.     glGetString:=GetProcAddress(GLHandle,'glGetString');
  2631.     glGetTexEnvfv:=GetProcAddress(GLHandle,'glGetTexEnvfv');
  2632.     glGetTexEnviv:=GetProcAddress(GLHandle,'glGetTexEnviv');
  2633.     glGetTexGendv:=GetProcAddress(GLHandle,'glGetTexGendv');
  2634.     glGetTexGenfv:=GetProcAddress(GLHandle,'glGetTexGenfv');
  2635.     glGetTexGeniv:=GetProcAddress(GLHandle,'glGetTexGeniv');
  2636.     glGetTexImage:=GetProcAddress(GLHandle,'glGetTexImage');
  2637.     glGetTexLevelParameterfv:=GetProcAddress(GLHandle,'glGetTexLevelParameterfv');
  2638.     glGetTexLevelParameteriv:=GetProcAddress(GLHandle,'glGetTexLevelParameteriv');
  2639.     glGetTexParameterfv:=GetProcAddress(GLHandle,'glGetTexParameterfv');
  2640.     glGetTexParameteriv:=GetProcAddress(GLHandle,'glGetTexParameteriv');
  2641.     glHint:=GetProcAddress(GLHandle,'glHint');
  2642.     glIndexMask:=GetProcAddress(GLHandle,'glIndexMask');
  2643.     glIndexPointer:=GetProcAddress(GLHandle,'glIndexPointer');
  2644.     glIndexd:=GetProcAddress(GLHandle,'glIndexd');
  2645.     glIndexdv:=GetProcAddress(GLHandle,'glIndexdv');
  2646.     glIndexf:=GetProcAddress(GLHandle,'glIndexf');
  2647.     glIndexfv:=GetProcAddress(GLHandle,'glIndexfv');
  2648.     glIndexi:=GetProcAddress(GLHandle,'glIndexi');
  2649.     glIndexiv:=GetProcAddress(GLHandle,'glIndexiv');
  2650.     glIndexs:=GetProcAddress(GLHandle,'glIndexs');
  2651.     glIndexsv:=GetProcAddress(GLHandle,'glIndexsv');
  2652.     glIndexub:=GetProcAddress(GLHandle,'glIndexub');
  2653.     glIndexubv:=GetProcAddress(GLHandle,'glIndexubv');
  2654.     glInitNames:=GetProcAddress(GLHandle,'glInitNames');
  2655.     glInterleavedArrays:=GetProcAddress(GLHandle,'glInterleavedArrays');
  2656.     glIsEnabled:=GetProcAddress(GLHandle,'glIsEnabled');
  2657.     glIsList:=GetProcAddress(GLHandle,'glIsList');
  2658.     glIsTexture:=GetProcAddress(GLHandle,'glIsTexture');
  2659.     glLightModelf:=GetProcAddress(GLHandle,'glLightModelf');
  2660.     glLightModelfv:=GetProcAddress(GLHandle,'glLightModelfv');
  2661.     glLightModeli:=GetProcAddress(GLHandle,'glLightModeli');
  2662.     glLightModeliv:=GetProcAddress(GLHandle,'glLightModeliv');
  2663.     glLightf:=GetProcAddress(GLHandle,'glLightf');
  2664.     glLightfv:=GetProcAddress(GLHandle,'glLightfv');
  2665.     glLighti:=GetProcAddress(GLHandle,'glLighti');
  2666.     glLightiv:=GetProcAddress(GLHandle,'glLightiv');
  2667.     glLineStipple:=GetProcAddress(GLHandle,'glLineStipple');
  2668.     glLineWidth:=GetProcAddress(GLHandle,'glLineWidth');
  2669.     glListBase:=GetProcAddress(GLHandle,'glListBase');
  2670.     glLoadIdentity:=GetProcAddress(GLHandle,'glLoadIdentity');
  2671.     glLoadMatrixd:=GetProcAddress(GLHandle,'glLoadMatrixd');
  2672.     glLoadMatrixf:=GetProcAddress(GLHandle,'glLoadMatrixf');
  2673.     glLoadName:=GetProcAddress(GLHandle,'glLoadName');
  2674.     glLogicOp:=GetProcAddress(GLHandle,'glLogicOp');
  2675.     glMap1d:=GetProcAddress(GLHandle,'glMap1d');
  2676.     glMap1f:=GetProcAddress(GLHandle,'glMap1f');
  2677.     glMap2d:=GetProcAddress(GLHandle,'glMap2d');
  2678.     glMap2f:=GetProcAddress(GLHandle,'glMap2f');
  2679.     glMapGrid1d:=GetProcAddress(GLHandle,'glMapGrid1d');
  2680.     glMapGrid1f:=GetProcAddress(GLHandle,'glMapGrid1f');
  2681.     glMapGrid2d:=GetProcAddress(GLHandle,'glMapGrid2d');
  2682.     glMapGrid2f:=GetProcAddress(GLHandle,'glMapGrid2f');
  2683.     glMaterialf:=GetProcAddress(GLHandle,'glMaterialf');
  2684.     glMaterialfv:=GetProcAddress(GLHandle,'glMaterialfv');
  2685.     glMateriali:=GetProcAddress(GLHandle,'glMateriali');
  2686.     glMaterialiv:=GetProcAddress(GLHandle,'glMaterialiv');
  2687.     glMatrixMode:=GetProcAddress(GLHandle,'glMatrixMode');
  2688.     glMultMatrixd:=GetProcAddress(GLHandle,'glMultMatrixd');
  2689.     glMultMatrixf:=GetProcAddress(GLHandle,'glMultMatrixf');
  2690.     glNewList:=GetProcAddress(GLHandle,'glNewList');
  2691.     glNormal3b:=GetProcAddress(GLHandle,'glNormal3b');
  2692.     glNormal3bv:=GetProcAddress(GLHandle,'glNormal3bv');
  2693.     glNormal3d:=GetProcAddress(GLHandle,'glNormal3d');
  2694.     glNormal3dv:=GetProcAddress(GLHandle,'glNormal3dv');
  2695.     glNormal3f:=GetProcAddress(GLHandle,'glNormal3f');
  2696.     glNormal3fv:=GetProcAddress(GLHandle,'glNormal3fv');
  2697.     glNormal3i:=GetProcAddress(GLHandle,'glNormal3i');
  2698.     glNormal3iv:=GetProcAddress(GLHandle,'glNormal3iv');
  2699.     glNormal3s:=GetProcAddress(GLHandle,'glNormal3s');
  2700.     glNormal3sv:=GetProcAddress(GLHandle,'glNormal3sv');
  2701.     glNormalPointer:=GetProcAddress(GLHandle,'glNormalPointer');
  2702.     glOrtho:=GetProcAddress(GLHandle,'glOrtho');
  2703.     glPassThrough:=GetProcAddress(GLHandle,'glPassThrough');
  2704.     glPixelMapfv:=GetProcAddress(GLHandle,'glPixelMapfv');
  2705.     glPixelMapuiv:=GetProcAddress(GLHandle,'glPixelMapuiv');
  2706.     glPixelMapusv:=GetProcAddress(GLHandle,'glPixelMapusv');
  2707.     glPixelStoref:=GetProcAddress(GLHandle,'glPixelStoref');
  2708.     glPixelStorei:=GetProcAddress(GLHandle,'glPixelStorei');
  2709.     glPixelTransferf:=GetProcAddress(GLHandle,'glPixelTransferf');
  2710.     glPixelTransferi:=GetProcAddress(GLHandle,'glPixelTransferi');
  2711.     glPixelZoom:=GetProcAddress(GLHandle,'glPixelZoom');
  2712.     glPointSize:=GetProcAddress(GLHandle,'glPointSize');
  2713.     glPolygonMode:=GetProcAddress(GLHandle,'glPolygonMode');
  2714.     glPolygonOffset:=GetProcAddress(GLHandle,'glPolygonOffset');
  2715.     glPolygonStipple:=GetProcAddress(GLHandle,'glPolygonStipple');
  2716.     glPopAttrib:=GetProcAddress(GLHandle,'glPopAttrib');
  2717.     glPopClientAttrib:=GetProcAddress(GLHandle,'glPopClientAttrib');
  2718.     glPopMatrix:=GetProcAddress(GLHandle,'glPopMatrix');
  2719.     glPopName:=GetProcAddress(GLHandle,'glPopName');
  2720.     glPrioritizeTextures:=GetProcAddress(GLHandle,'glPrioritizeTextures');
  2721.     glPushAttrib:=GetProcAddress(GLHandle,'glPushAttrib');
  2722.     glPushClientAttrib:=GetProcAddress(GLHandle,'glPushClientAttrib');
  2723.     glPushMatrix:=GetProcAddress(GLHandle,'glPushMatrix');
  2724.     glPushName:=GetProcAddress(GLHandle,'glPushName');
  2725.     glRasterPos2d:=GetProcAddress(GLHandle,'glRasterPos2d');
  2726.     glRasterPos2dv:=GetProcAddress(GLHandle,'glRasterPos2dv');
  2727.     glRasterPos2f:=GetProcAddress(GLHandle,'glRasterPos2f');
  2728.     glRasterPos2fv:=GetProcAddress(GLHandle,'glRasterPos2fv');
  2729.     glRasterPos2i:=GetProcAddress(GLHandle,'glRasterPos2i');
  2730.     glRasterPos2iv:=GetProcAddress(GLHandle,'glRasterPos2iv');
  2731.     glRasterPos2s:=GetProcAddress(GLHandle,'glRasterPos2s');
  2732.     glRasterPos2sv:=GetProcAddress(GLHandle,'glRasterPos2sv');
  2733.     glRasterPos3d:=GetProcAddress(GLHandle,'glRasterPos3d');
  2734.     glRasterPos3dv:=GetProcAddress(GLHandle,'glRasterPos3dv');
  2735.     glRasterPos3f:=GetProcAddress(GLHandle,'glRasterPos3f');
  2736.     glRasterPos3fv:=GetProcAddress(GLHandle,'glRasterPos3fv');
  2737.     glRasterPos3i:=GetProcAddress(GLHandle,'glRasterPos3i');
  2738.     glRasterPos3iv:=GetProcAddress(GLHandle,'glRasterPos3iv');
  2739.     glRasterPos3s:=GetProcAddress(GLHandle,'glRasterPos3s');
  2740.     glRasterPos3sv:=GetProcAddress(GLHandle,'glRasterPos3sv');
  2741.     glRasterPos4d:=GetProcAddress(GLHandle,'glRasterPos4d');
  2742.     glRasterPos4dv:=GetProcAddress(GLHandle,'glRasterPos4dv');
  2743.     glRasterPos4f:=GetProcAddress(GLHandle,'glRasterPos4f');
  2744.     glRasterPos4fv:=GetProcAddress(GLHandle,'glRasterPos4fv');
  2745.     glRasterPos4i:=GetProcAddress(GLHandle,'glRasterPos4i');
  2746.     glRasterPos4iv:=GetProcAddress(GLHandle,'glRasterPos4iv');
  2747.     glRasterPos4s:=GetProcAddress(GLHandle,'glRasterPos4s');
  2748.     glRasterPos4sv:=GetProcAddress(GLHandle,'glRasterPos4sv');
  2749.     glReadBuffer:=GetProcAddress(GLHandle,'glReadBuffer');
  2750.     glReadPixels:=GetProcAddress(GLHandle,'glReadPixels');
  2751.     glRectd:=GetProcAddress(GLHandle,'glRectd');
  2752.     glRectdv:=GetProcAddress(GLHandle,'glRectdv');
  2753.     glRectf:=GetProcAddress(GLHandle,'glRectf');
  2754.     glRectfv:=GetProcAddress(GLHandle,'glRectfv');
  2755.     glRecti:=GetProcAddress(GLHandle,'glRecti');
  2756.     glRectiv:=GetProcAddress(GLHandle,'glRectiv');
  2757.     glRects:=GetProcAddress(GLHandle,'glRects');
  2758.     glRectsv:=GetProcAddress(GLHandle,'glRectsv');
  2759.     glRenderMode:=GetProcAddress(GLHandle,'glRenderMode');
  2760.     glRotated:=GetProcAddress(GLHandle,'glRotated');
  2761.     glRotatef:=GetProcAddress(GLHandle,'glRotatef');
  2762.     glScaled:=GetProcAddress(GLHandle,'glScaled');
  2763.     glScalef:=GetProcAddress(GLHandle,'glScalef');
  2764.     glScissor:=GetProcAddress(GLHandle,'glScissor');
  2765.     glSelectBuffer:=GetProcAddress(GLHandle,'glSelectBuffer');
  2766.     glShadeModel:=GetProcAddress(GLHandle,'glShadeModel');
  2767.     glStencilFunc:=GetProcAddress(GLHandle,'glStencilFunc');
  2768.     glStencilMask:=GetProcAddress(GLHandle,'glStencilMask');
  2769.     glStencilOp:=GetProcAddress(GLHandle,'glStencilOp');
  2770.     glTexCoord1d:=GetProcAddress(GLHandle,'glTexCoord1d');
  2771.     glTexCoord1dv:=GetProcAddress(GLHandle,'glTexCoord1dv');
  2772.     glTexCoord1f:=GetProcAddress(GLHandle,'glTexCoord1f');
  2773.     glTexCoord1fv:=GetProcAddress(GLHandle,'glTexCoord1fv');
  2774.     glTexCoord1i:=GetProcAddress(GLHandle,'glTexCoord1i');
  2775.     glTexCoord1iv:=GetProcAddress(GLHandle,'glTexCoord1iv');
  2776.     glTexCoord1s:=GetProcAddress(GLHandle,'glTexCoord1s');
  2777.     glTexCoord1sv:=GetProcAddress(GLHandle,'glTexCoord1sv');
  2778.     glTexCoord2d:=GetProcAddress(GLHandle,'glTexCoord2d');
  2779.     glTexCoord2dv:=GetProcAddress(GLHandle,'glTexCoord2dv');
  2780.     glTexCoord2f:=GetProcAddress(GLHandle,'glTexCoord2f');
  2781.     glTexCoord2fv:=GetProcAddress(GLHandle,'glTexCoord2fv');
  2782.     glTexCoord2i:=GetProcAddress(GLHandle,'glTexCoord2i');
  2783.     glTexCoord2iv:=GetProcAddress(GLHandle,'glTexCoord2iv');
  2784.     glTexCoord2s:=GetProcAddress(GLHandle,'glTexCoord2s');
  2785.     glTexCoord2sv:=GetProcAddress(GLHandle,'glTexCoord2sv');
  2786.     glTexCoord3d:=GetProcAddress(GLHandle,'glTexCoord3d');
  2787.     glTexCoord3dv:=GetProcAddress(GLHandle,'glTexCoord3dv');
  2788.     glTexCoord3f:=GetProcAddress(GLHandle,'glTexCoord3f');
  2789.     glTexCoord3fv:=GetProcAddress(GLHandle,'glTexCoord3fv');
  2790.     glTexCoord3i:=GetProcAddress(GLHandle,'glTexCoord3i');
  2791.     glTexCoord3iv:=GetProcAddress(GLHandle,'glTexCoord3iv');
  2792.     glTexCoord3s:=GetProcAddress(GLHandle,'glTexCoord3s');
  2793.     glTexCoord3sv:=GetProcAddress(GLHandle,'glTexCoord3sv');
  2794.     glTexCoord4d:=GetProcAddress(GLHandle,'glTexCoord4d');
  2795.     glTexCoord4dv:=GetProcAddress(GLHandle,'glTexCoord4dv');
  2796.     glTexCoord4f:=GetProcAddress(GLHandle,'glTexCoord4f');
  2797.     glTexCoord4fv:=GetProcAddress(GLHandle,'glTexCoord4fv');
  2798.     glTexCoord4i:=GetProcAddress(GLHandle,'glTexCoord4i');
  2799.     glTexCoord4iv:=GetProcAddress(GLHandle,'glTexCoord4iv');
  2800.     glTexCoord4s:=GetProcAddress(GLHandle,'glTexCoord4s');
  2801.     glTexCoord4sv:=GetProcAddress(GLHandle,'glTexCoord4sv');
  2802.     glTexCoordPointer:=GetProcAddress(GLHandle,'glTexCoordPointer');
  2803.     glTexEnvf:=GetProcAddress(GLHandle,'glTexEnvf');
  2804.     glTexEnvfv:=GetProcAddress(GLHandle,'glTexEnvfv');
  2805.     glTexEnvi:=GetProcAddress(GLHandle,'glTexEnvi');
  2806.     glTexEnviv:=GetProcAddress(GLHandle,'glTexEnviv');
  2807.     glTexGend:=GetProcAddress(GLHandle,'glTexGend');
  2808.     glTexGendv:=GetProcAddress(GLHandle,'glTexGendv');
  2809.     glTexGenf:=GetProcAddress(GLHandle,'glTexGenf');
  2810.     glTexGenfv:=GetProcAddress(GLHandle,'glTexGenfv');
  2811.     glTexGeni:=GetProcAddress(GLHandle,'glTexGeni');
  2812.     glTexGeniv:=GetProcAddress(GLHandle,'glTexGeniv');
  2813.     glTexImage1D:=GetProcAddress(GLHandle,'glTexImage1D');
  2814.     glTexImage2D:=GetProcAddress(GLHandle,'glTexImage2D');
  2815.     glTexParameterf:=GetProcAddress(GLHandle,'glTexParameterf');
  2816.     glTexParameterfv:=GetProcAddress(GLHandle,'glTexParameterfv');
  2817.     glTexParameteri:=GetProcAddress(GLHandle,'glTexParameteri');
  2818.     glTexParameteriv:=GetProcAddress(GLHandle,'glTexParameteriv');
  2819.     glTexSubImage1D:=GetProcAddress(GLHandle,'glTexSubImage1D');
  2820.     glTexSubImage2D:=GetProcAddress(GLHandle,'glTexSubImage2D');
  2821.     glTranslated:=GetProcAddress(GLHandle,'glTranslated');
  2822.     glTranslatef:=GetProcAddress(GLHandle,'glTranslatef');
  2823.     glVertex2d:=GetProcAddress(GLHandle,'glVertex2d');
  2824.     glVertex2dv:=GetProcAddress(GLHandle,'glVertex2dv');
  2825.     glVertex2f:=GetProcAddress(GLHandle,'glVertex2f');
  2826.     glVertex2fv:=GetProcAddress(GLHandle,'glVertex2fv');
  2827.     glVertex2i:=GetProcAddress(GLHandle,'glVertex2i');
  2828.     glVertex2iv:=GetProcAddress(GLHandle,'glVertex2iv');
  2829.     glVertex2s:=GetProcAddress(GLHandle,'glVertex2s');
  2830.     glVertex2sv:=GetProcAddress(GLHandle,'glVertex2sv');
  2831.     glVertex3d:=GetProcAddress(GLHandle,'glVertex3d');
  2832.     glVertex3dv:=GetProcAddress(GLHandle,'glVertex3dv');
  2833.     glVertex3f:=GetProcAddress(GLHandle,'glVertex3f');
  2834.     glVertex3fv:=GetProcAddress(GLHandle,'glVertex3fv');
  2835.     glVertex3i:=GetProcAddress(GLHandle,'glVertex3i');
  2836.     glVertex3iv:=GetProcAddress(GLHandle,'glVertex3iv');
  2837.     glVertex3s:=GetProcAddress(GLHandle,'glVertex3s');
  2838.     glVertex3sv:=GetProcAddress(GLHandle,'glVertex3sv');
  2839.     glVertex4d:=GetProcAddress(GLHandle,'glVertex4d');
  2840.     glVertex4dv:=GetProcAddress(GLHandle,'glVertex4dv');
  2841.     glVertex4f:=GetProcAddress(GLHandle,'glVertex4f');
  2842.     glVertex4fv:=GetProcAddress(GLHandle,'glVertex4fv');
  2843.     glVertex4i:=GetProcAddress(GLHandle,'glVertex4i');
  2844.     glVertex4iv:=GetProcAddress(GLHandle,'glVertex4iv');
  2845.     glVertex4s:=GetProcAddress(GLHandle,'glVertex4s');
  2846.     glVertex4sv:=GetProcAddress(GLHandle,'glVertex4sv');
  2847.     glVertexPointer:=GetProcAddress(GLHandle,'glVertexPointer');
  2848.     glViewport:=GetProcAddress(GLHandle,'glViewport');
  2849.     wglCopyContext:=GetProcAddress(GLHandle,'wglCopyContext');
  2850.     wglCreateContext:=GetProcAddress(GLHandle,'wglCreateContext');
  2851.     wglCreateLayerContext:=GetProcAddress(GLHandle,'wglCreateLayerContext');
  2852.     wglDeleteContext:=GetProcAddress(GLHandle,'wglDeleteContext');
  2853.     wglGetCurrentContext:=GetProcAddress(GLHandle,'wglGetCurrentContext');
  2854.     wglGetCurrentDC:=GetProcAddress(GLHandle,'wglGetCurrentDC');
  2855.     wglGetProcAddress:=GetprocAddress(GLHandle,'wglGetProcAddress');
  2856.     wglMakeCurrent:=GetProcAddress(GLHandle,'wglMakeCurrent');
  2857.     wglShareLists:=GetProcAddress(GLHandle,'wglShareLists');
  2858.     wglUseFontBitmapsA:=GetProcAddress(GLHandle,'wglUseFontBitmapsA');
  2859.     wglUseFontBitmapsW:=GetProcAddress(GLHandle,'wglUseFontBitmapsW');
  2860.     wglUseFontBitmaps:=GetProcAddress(GLHandle,'wglUseFontBitmapsA');
  2861.     wglUseFontOutlinesA:=GetProcAddress(GLHandle,'wglUseFontOutlinesA');
  2862.     wglUseFontOutlinesW:=GetProcAddress(GLHandle,'wglUseFontOutlinesW');
  2863.     wglUseFontOutlines:=GetProcAddress(GLHandle,'wglUseFontOutlinesA');
  2864.     wglDescribeLayerPlane:=GetProcAddress(GLHandle,'wglDescribeLayerPlane');
  2865.     wglSetLayerPaletteEntries:=GetProcAddress(GLHandle,'wglSetLayerPaletteEntries');
  2866.     wglGetLayerPaletteEntries:=GetProcAddress(GLHandle,'wglGetLayerPaletteEntries');
  2867.     wglRealizeLayerPalette:=GetProcAddress(GLHandle,'wglRealizeLayerPalette');
  2868.     wglSwapLayerBuffers:=GetProcAddress(GLHandle,'wglSwapLayerBuffers');
  2869.  
  2870.     // GL 1.2
  2871.     glDrawRangeElements:=GetProcAddress(GLHandle,'glDrawRangeElements');
  2872.     glTexImage3D:=GetProcAddress(GLHandle,'glTexImage3D');
  2873.     // GL 1.2 ARB imaging
  2874.     glBlendColor:=GetProcAddress(GLHandle,'glBlendColor');
  2875.     glBlendEquation:=GetProcAddress(GLHandle,'glBlendEquation');
  2876.     glColorSubTable:=GetProcAddress(GLHandle,'glColorSubTable');
  2877.     glCopyColorSubTable:=GetProcAddress(GLHandle,'glCopyColorSubTable');
  2878.     glColorTable:=GetProcAddress(GLHandle,'glCopyColorSubTable');
  2879.     glCopyColorTable:=GetProcAddress(GLHandle,'glCopyColorTable');
  2880.     glColorTableParameteriv:=GetProcAddress(GLHandle,'glColorTableParameteriv');
  2881.     glColorTableParameterfv:=GetProcAddress(GLHandle,'glColorTableParameterfv');
  2882.     glGetColorTable:=GetProcAddress(GLHandle,'glGetColorTable');
  2883.     glGetColorTableParameteriv:=GetProcAddress(GLHandle,'glGetColorTableParameteriv');
  2884.     glGetColorTableParameterfv:=GetProcAddress(GLHandle,'glGetColorTableParameterfv');
  2885.     glConvolutionFilter1D:=GetProcAddress(GLHandle,'glConvolutionFilter1D');
  2886.     glConvolutionFilter2D:=GetProcAddress(GLHandle,'glConvolutionFilter2D');
  2887.     glCopyConvolutionFilter1D:=GetProcAddress(GLHandle,'glCopyConvolutionFilter1D');
  2888.     glCopyConvolutionFilter2D:=GetProcAddress(GLHandle,'glCopyConvolutionFilter2D');
  2889.     glGetConvolutionFilter:=GetProcAddress(GLHandle,'glGetConvolutionFilter');
  2890.     glSeparableFilter2D:=GetProcAddress(GLHandle,'glSeparableFilter2D');
  2891.     glGetSeparableFilter:=GetProcAddress(GLHandle,'glGetSeparableFilter');
  2892.     glConvolutionParameteri:=GetProcAddress(GLHandle,'glConvolutionParameteri');
  2893.     glConvolutionParameteriv:=GetProcAddress(GLHandle,'glConvolutionParameteriv');
  2894.     glConvolutionParameterf:=GetProcAddress(GLHandle,'glConvolutionParameterf');
  2895.     glConvolutionParameterfv:=GetProcAddress(GLHandle,'glConvolutionParameterfv');
  2896.     glGetConvolutionParameteriv:=GetProcAddress(GLHandle,'glGetConvolutionParameteriv');
  2897.     glGetConvolutionParameterfv:=GetProcAddress(GLHandle,'glGetConvolutionParameterfv');
  2898.     glHistogram:=GetProcAddress(GLHandle,'glHistogram');
  2899.     glResetHistogram:=GetProcAddress(GLHandle,'glResetHistogram');
  2900.     glGetHistogram:=GetProcAddress(GLHandle,'glGetHistogram');
  2901.     glGetHistogramParameteriv:=GetProcAddress(GLHandle,'glGetHistogramParameteriv');
  2902.     glGetHistogramParameterfv:=GetProcAddress(GLHandle,'glGetHistogramParameterfv');
  2903.     glMinmax:=GetProcAddress(GLHandle,'glMinmax');
  2904.     glResetMinmax:=GetProcAddress(GLHandle,'glResetMinmax');
  2905.     glGetMinmax:=GetProcAddress(GLHandle,'glGetMinmax');
  2906.     glGetMinmaxParameteriv:=GetProcAddress(GLHandle,'glGetMinmaxParameteriv');
  2907.     glGetMinmaxParameterfv:=GetProcAddress(GLHandle,'glGetMinmaxParameterfv');
  2908.   end;
  2909.  
  2910.   if GLUHandle > 0 then
  2911.   begin
  2912.     gluBeginCurve:=GetProcAddress(GLUHandle,'gluBeginCurve');
  2913.     gluBeginPolygon:=GetProcAddress(GLUHandle,'gluBeginPolygon');
  2914.     gluBeginSurface:=GetProcAddress(GLUHandle,'gluBeginSurface');
  2915.     gluBeginTrim:=GetProcAddress(GLUHandle,'gluBeginTrim');
  2916.     gluBuild1DMipmaps:=GetProcAddress(GLUHandle,'gluBuild1DMipmaps');
  2917.     gluBuild2DMipmaps:=GetProcAddress(GLUHandle,'gluBuild2DMipmaps');
  2918.     gluCylinder:=GetProcAddress(GLUHandle,'gluCylinder');
  2919.     gluDeleteNurbsRenderer:=GetProcAddress(GLUHandle,'gluDeleteNurbsRenderer');
  2920.     gluDeleteQuadric:=GetProcAddress(GLUHandle,'gluDeleteQuadric');
  2921.     gluDeleteTess:=GetProcAddress(GLUHandle,'gluDeleteTess');
  2922.     gluDisk:=GetProcAddress(GLUHandle,'gluDisk');
  2923.     gluEndCurve:=GetProcAddress(GLUHandle,'gluEndCurve');
  2924.     gluEndPolygon:=GetProcAddress(GLUHandle,'gluEndPolygon');
  2925.     gluEndSurface:=GetProcAddress(GLUHandle,'gluEndSurface');
  2926.     gluEndTrim:=GetProcAddress(GLUHandle,'gluEndTrim');
  2927.     gluErrorString:=GetProcAddress(GLUHandle,'gluErrorString');
  2928.     gluGetNurbsProperty:=GetProcAddress(GLUHandle,'gluGetNurbsProperty');
  2929.     gluGetString:=GetProcAddress(GLUHandle,'gluGetString');
  2930.     gluGetTessProperty:=GetProcAddress(GLUHandle,'gluGetTessProperty');
  2931.     gluLoadSamplingMatrices:=GetProcAddress(GLUHandle,'gluLoadSamplingMatrices');
  2932.     gluLookAt:=GetProcAddress(GLUHandle,'gluLookAt');
  2933.     gluNewNurbsRenderer:=GetProcAddress(GLUHandle,'gluNewNurbsRenderer');
  2934.     gluNewQuadric:=GetProcAddress(GLUHandle,'gluNewQuadric');
  2935.     gluNewTess:=GetProcAddress(GLUHandle,'gluNewTess');
  2936.     gluNextContour:=GetProcAddress(GLUHandle,'gluNextContour');
  2937.     gluNurbsCallback:=GetProcAddress(GLUHandle,'gluNurbsCallback');
  2938.     gluNurbsCurve:=GetProcAddress(GLUHandle,'gluNurbsCurve');
  2939.     gluNurbsProperty:=GetProcAddress(GLUHandle,'gluNurbsProperty');
  2940.     gluNurbsSurface:=GetProcAddress(GLUHandle,'gluNurbsSurface');
  2941.     gluOrtho2D:=GetProcAddress(GLUHandle,'gluOrtho2D');
  2942.     gluPartialDisk:=GetProcAddress(GLUHandle,'gluPartialDisk');
  2943.     gluPerspective:=GetProcAddress(GLUHandle,'gluPerspective');
  2944.     gluPickMatrix:=GetProcAddress(GLUHandle,'gluPickMatrix');
  2945.     gluProject:=GetProcAddress(GLUHandle,'gluProject');
  2946.     gluPwlCurve:=GetProcAddress(GLUHandle,'gluPwlCurve');
  2947.     gluQuadricCallback:=GetProcAddress(GLUHandle,'gluQuadricCallback');
  2948.     gluQuadricDrawStyle:=GetProcAddress(GLUHandle,'gluQuadricDrawStyle');
  2949.     gluQuadricNormals:=GetProcAddress(GLUHandle,'gluQuadricNormals');
  2950.     gluQuadricOrientation:=GetProcAddress(GLUHandle,'gluQuadricOrientation');
  2951.     gluQuadricTexture:=GetProcAddress(GLUHandle,'gluQuadricTexture');
  2952.     gluScaleImage:=GetProcAddress(GLUHandle,'gluScaleImage');
  2953.     gluSphere:=GetProcAddress(GLUHandle,'gluSphere');
  2954.     gluTessBeginContour:=GetProcAddress(GLUHandle,'gluTessBeginContour');
  2955.     gluTessBeginPolygon:=GetProcAddress(GLUHandle,'gluTessBeginPolygon');
  2956.     gluTessCallback:=GetProcAddress(GLUHandle,'gluTessCallback');
  2957.     gluTessEndContour:=GetProcAddress(GLUHandle,'gluTessEndContour');
  2958.     gluTessEndPolygon:=GetProcAddress(GLUHandle,'gluTessEndPolygon');
  2959.     gluTessNormal:=GetProcAddress(GLUHandle,'gluTessNormal');
  2960.     gluTessProperty:=GetProcAddress(GLUHandle,'gluTessProperty');
  2961.     gluTessVertex:=GetProcAddress(GLUHandle,'gluTessVertex');
  2962.     gluUnProject:=GetProcAddress(GLUHandle,'gluUnProject');
  2963.   end;
  2964.  
  2965.   SwapBuffers:=GetProcAddress(GLHandle,'wglSwapBuffers');
  2966.   ChoosePixelFormat:=GetProcAddress(GLHandle,'wglChoosePixelFormat');
  2967.   GetPixelFormat:=GetProcAddress(GLHandle,'wglGetPixelFormat');
  2968.   SetPixelFormat:=GetProcAddress(GLHandle,'SetPixelFormat');
  2969.   if not assigned(SetPixelFormat) then SetPixelFormat:=Windows.SetPixelFormat;
  2970.   DescribePixelFormat:=GetProcAddress(GLHandle,'wglDescribePixelFormat');
  2971. end;
  2972.  
  2973. //------------------------------------------------------------------------------
  2974.  
  2975. procedure ClearExtensions;
  2976.  
  2977. begin
  2978.   glArrayElementEXT:=nil;
  2979.   glDrawArraysEXT:=nil;
  2980.   glVertexPointerEXT:=nil;
  2981.   glNormalPointerEXT:=nil;
  2982.   glColorPointerEXT:=nil;
  2983.   glIndexPointerEXT:=nil;
  2984.   glTexCoordPointerEXT:=nil;
  2985.   glEdgeFlagPointerEXT:=nil;
  2986.   glGetPointervEXT:=nil;
  2987.   glArrayElementArrayEXT:=nil;
  2988.   glAddSwapHintRectWIN:=nil;
  2989.   glColorTableEXT:=nil;
  2990.   glColorSubTableEXT:=nil;
  2991.   glGetColorTableEXT:=nil;
  2992.   glGetColorTablePameterivEXT:=nil;
  2993.   glGetColorTablePameterfvEXT:=nil;
  2994.   gluNurbsCallbackDataEXT:=nil;
  2995.   gluNewNurbsTessellatorEXT:=nil;
  2996.   gluDeleteNurbsTessellatorEXT:=nil;
  2997.   glLockArraysEXT:=nil;
  2998.   glUnlockArraysEXT:=nil;
  2999.   glCopyTexImage1DEXT:=nil;
  3000.   glCopyTexSubImage1DEXT:=nil;
  3001.   glCopyTexImage2DEXT:=nil;
  3002.   glCopyTexSubImage2DEXT:=nil;
  3003.   glCopyTexSubImage3DEXT:=nil;
  3004.   glCullParameterfvEXT:=nil;
  3005.   glCullParameterdvEXT:=nil;
  3006.   glIndexFuncEXT:=nil;
  3007.   glIndexMaterialEXT:=nil;
  3008.   glPolygonOffsetEXT:=nil;
  3009.   glTexSubImage1DEXT:=nil;
  3010.   glTexSubImage2DEXT:=nil;
  3011.   glTexSubImage3DEXT:=nil;
  3012.   glGenTexturesEXT:=nil;
  3013.   glDeleteTexturesEXT:=nil;
  3014.   glBindTextureEXT:=nil;
  3015.   glPrioritizeTexturesEXT:=nil;
  3016.   glAreTexturesResidentEXT:=nil;
  3017.   glIsTextureEXT:=nil;
  3018.  
  3019.   LastPixelFormat:=0; // to get synchronized again, if this proc was called from outside
  3020. end;
  3021.  
  3022. //------------------------------------------------------------------------------
  3023.  
  3024. procedure ReadExtensions;
  3025.  
  3026. // to be used in an active rendering context only!
  3027.  
  3028. begin
  3029.   // GL extensions
  3030.   glArrayElementEXT:=wglGetProcAddress('glArrayElementEXT');
  3031.   glDrawArraysEXT:=wglGetProcAddress('glDrawArraysEXT');
  3032.   glVertexPointerEXT:=wglGetProcAddress('glVertexPointerEXT');
  3033.   glNormalPointerEXT:=wglGetProcAddress('glNormalPointerEXT');
  3034.   glColorPointerEXT:=wglGetProcAddress('glColorPointerEXT');
  3035.   glIndexPointerEXT:=wglGetProcAddress('glIndexPointerEXT');
  3036.   glTexCoordPointerEXT:=wglGetProcAddress('glTexCoordPointerEXT');
  3037.   glEdgeFlagPointerEXT:=wglGetProcAddress('glEdgeFlagPointerEXT');
  3038.   glGetPointervEXT:=wglGetProcAddress('glGetPointervEXT');
  3039.   glArrayElementArrayEXT:=wglGetProcAddress('glArrayElementArrayEXT');
  3040.   glAddSwapHintRectWIN:=wglGetProcAddress('glAddSwapHintRectWIN');
  3041.   glColorTableEXT:=wglGetProcAddress('glColorTableEXT');
  3042.   glColorSubTableEXT:=wglGetProcAddress('glColorSubTableEXT');
  3043.   glGetColorTableEXT:=wglGetProcAddress('glGetColorTableEXT');
  3044.   glGetColorTablePameterivEXT:=wglGetProcAddress('glGetColorTablePameterivEXT');
  3045.   glGetColorTablePameterfvEXT:=wglGetProcAddress('glGetColorTablePameterfvEXT');
  3046.   glLockArraysEXT:=wglGetProcAddress('glLockArraysEXT');
  3047.   glUnlockArraysEXT:=wglGetProcAddress('glUnlockArraysEXT');
  3048.   glCopyTexImage1DEXT:=wglGetProcAddress('glCopyTexImage1DEXT');
  3049.   glCopyTexSubImage1DEXT:=wglGetProcAddress('glCopyTexSubImage1DEXT');
  3050.   glCopyTexImage2DEXT:=wglGetProcAddress('glCopyTexImage2DEXT');
  3051.   glCopyTexSubImage2DEXT:=wglGetProcAddress('glCopyTexSubImage2DEXT');
  3052.   glCopyTexSubImage3DEXT:=wglGetProcAddress('glCopyTexSubImage3DEXT');
  3053.   glCullParameterfvEXT:=wglGetProcAddress('glCullParameterfvEXT');
  3054.   glCullParameterdvEXT:=wglGetProcAddress('glCullParameterdvEXT');
  3055.   glIndexFuncEXT:=wglGetProcAddress('glIndexFuncEXT');
  3056.   glIndexMaterialEXT:=wglGetProcAddress('glIndexMaterialEXT');
  3057.   glPolygonOffsetEXT:=wglGetProcAddress('glPolygonOffsetEXT');
  3058.   glTexSubImage1DEXT:=wglGetProcAddress('glTexSubImage1DEXT');
  3059.   glTexSubImage2DEXT:=wglGetProcAddress('glTexSubImage2DEXT');
  3060.   glTexSubImage3DEXT:=wglGetProcAddress('glTexSubImage3DEXT');
  3061.   glGenTexturesEXT:=wglGetProcAddress('glGenTexturesEXT');
  3062.   glDeleteTexturesEXT:=wglGetProcAddress('glDeleteTexturesEXT');
  3063.   glBindTextureEXT:=wglGetProcAddress('glBindTextureEXT');
  3064.   glPrioritizeTexturesEXT:=wglGetProcAddress('glPrioritizeTexturesEXT');
  3065.   glAreTexturesResidentEXT:=wglGetProcAddress('glAreTexturesResidentEXT');
  3066.   glIsTextureEXT:=wglGetProcAddress('glIsTextureEXT');
  3067.  
  3068.   // GLU extensions
  3069.   gluNurbsCallbackDataEXT:=wglGetProcAddress('gluNurbsCallbackDataEXT');
  3070.   gluNewNurbsTessellatorEXT:=wglGetProcAddress('gluNewNurbsTessellatorEXT');
  3071.   gluDeleteNurbsTessellatorEXT:=wglGetProcAddress('gluDeleteNurbsTessellatorEXT');
  3072.  
  3073.   LastPixelFormat:=0; // to get synchronized again, if this proc was called from outside
  3074. end;
  3075.  
  3076. //------------------------------------------------------------------------------
  3077.  
  3078. procedure ReadImplementationProperties;
  3079.  
  3080. var Buffer        : String;
  3081.     MajorVersion,
  3082.     MinorVersion  : Byte;
  3083.     Separator     : Byte;
  3084.  
  3085. begin
  3086.   // determine version of implementation
  3087.   // -- first GL
  3088.   Buffer:=StrPas(PChar(glGetString(GL_VERSION)));
  3089.   Separator:=Pos('.',Buffer);
  3090.   if Separator > 0 then MajorVersion:=StrToInt(Copy(Buffer,1,Separator-1))
  3091.                    else MajorVersion:=0;
  3092.   Delete(Buffer,1,Separator);
  3093.   Separator:=Pos('.',Buffer);
  3094.   if Separator > 0 then MinorVersion:=StrToInt(Copy(Buffer,1,Separator-1))
  3095.                    else MinorVersion:=0;
  3096.   GL_VERSION_1_0:=False;
  3097.   GL_VERSION_1_1:=False;
  3098.   GL_VERSION_1_2:=False;
  3099.   if MajorVersion > 0 then
  3100.   begin
  3101.     GL_VERSION_1_0:=True;
  3102.     if MinorVersion > 0 then
  3103.     begin
  3104.       GL_VERSION_1_1:=True;
  3105.       if MinorVersion > 1 then GL_VERSION_1_2:=True;
  3106.     end;
  3107.   end;
  3108.   // -- second GLU
  3109.   GLU_VERSION_1_1:=False;
  3110.   GLU_VERSION_1_2:=False;
  3111.   // gluGetString is valid for version 1.1 or later
  3112.   if assigned(gluGetString) then
  3113.   begin
  3114.     Buffer:=StrPas(PChar(gluGetString(GLU_VERSION)));
  3115.     Separator:=Pos('.',Buffer);
  3116.     if Separator > 1 then
  3117.     begin
  3118.       Dec(Separator);
  3119.       while (Separator > 0) and (Buffer[Separator] in ['0'..'9']) do Dec(Separator);
  3120.       Delete(Buffer,1,Separator);
  3121.       Separator:=Pos('.',Buffer);
  3122.       MajorVersion:=StrToInt(Copy(Buffer,1,Separator-1));
  3123.       Delete(Buffer,1,Separator);
  3124.     end
  3125.     else MajorVersion:=0;
  3126.     Separator:=Pos('.',Buffer);
  3127.     if Separator > 0 then MinorVersion:=StrToInt(Copy(Buffer,1,Separator-1))
  3128.                      else
  3129.       if Length(Buffer) > 0 then MinorVersion:=StrToInt(Buffer)
  3130.                             else MinorVersion:=0;
  3131.     if (MajorVersion > 0) and (MinorVersion > 0) then
  3132.     begin
  3133.       GLU_VERSION_1_1:=True;
  3134.       if MinorVersion > 1 then GLU_VERSION_1_2:=True;
  3135.     end;
  3136.   end;
  3137.  
  3138.   // check supported extensions
  3139.   // -- first GL
  3140.   Buffer:=StrPas(PChar(glGetString(GL_EXTENSIONS)));
  3141.   if Pos('GL_EXT_abgr',Buffer) > 0 then GL_EXT_abgr:=True
  3142.                                    else GL_EXT_abgr:=False;
  3143.   if Pos('GL_EXT_bgra',Buffer) > 0 then GL_EXT_bgra:=True
  3144.                                    else GL_EXT_bgra:=False;
  3145.   if Pos('GL_EXT_packed_pixels',Buffer) > 0 then GL_EXT_packed_pixels:=True
  3146.                                             else GL_EXT_packed_pixels:=False;
  3147.   if Pos('GL_EXT_paletted_texture',Buffer) > 0 then GL_EXT_paletted_texture:=True
  3148.                                                else GL_EXT_paletted_texture:=False;
  3149.   if Pos('GL_EXT_vertex_array',Buffer) > 0 then GL_EXT_vertex_array:=True
  3150.                                            else GL_EXT_vertex_array:=False;
  3151.   if Pos('GL_SGI_compiled_vertex_array',Buffer) > 0 then GL_SGI_compiled_vertex_array:=True
  3152.                                                     else GL_SGI_compiled_vertex_array:=False;
  3153.   if Pos('GL_SGI_cull_vertex',Buffer) > 0 then GL_SGI_cull_vertex:=True
  3154.                                           else GL_SGI_cull_vertex:=False;
  3155.   if Pos('GL_SGI_index_array_formats',Buffer) > 0 then GL_SGI_index_array_formats:=True
  3156.                                                   else GL_SGI_index_array_formats:=False;
  3157.   if Pos('GL_SGI_index_func',Buffer) > 0 then GL_SGI_index_func:=True
  3158.                                          else GL_SGI_index_func:=False;
  3159.   if Pos('GL_SGI_index_material',Buffer) > 0 then GL_SGI_index_material:=True
  3160.                                              else GL_SGI_index_material:=False;
  3161.   if Pos('GL_SGI_index_texture',Buffer) > 0 then GL_SGI_index_texture:=True
  3162.                                             else GL_SGI_index_texture:=False;
  3163.   if Pos('GL_WIN_swap_hint',Buffer) > 0 then GL_WIN_swap_hint:=True
  3164.                                         else GL_WIN_swap_hint:=False;
  3165.   if Pos('GL_EXT_blend_color',Buffer) > 0 then GL_EXT_blend_color:=True
  3166.                                           else GL_EXT_blend_color:=False;
  3167.   if Pos('GL_EXT_blend_logic_op',Buffer) > 0 then GL_EXT_blend_logic_op:=True
  3168.                                              else GL_EXT_blend_logic_op:=False;
  3169.   if Pos('GL_EXT_blend_minmax',Buffer) > 0 then GL_EXT_blend_minmax:=True
  3170.                                            else GL_EXT_blend_minmax:=False;
  3171.   if Pos('GL_EXT_blend_subtract',Buffer) > 0 then GL_EXT_blend_subtract:=True
  3172.                                              else GL_EXT_blend_subtract:=False;
  3173.   if Pos('GL_EXT_convolution',Buffer) > 0 then GL_EXT_convolution:=True
  3174.                                           else GL_EXT_convolution:=False;
  3175.   if Pos('GL_EXT_copy_texture',Buffer) > 0 then GL_EXT_copy_texture:=True
  3176.                                            else GL_EXT_copy_texture:=False;
  3177.   if Pos('GL_EXT_histogram',Buffer) > 0 then GL_EXT_histogram:=True
  3178.                                         else GL_EXT_histogram:=False;
  3179.   if Pos('GL_EXT_polygon_offset',Buffer) > 0 then GL_EXT_polygon_offset:=True
  3180.                                              else GL_EXT_polygon_offset:=False;
  3181.   if Pos('GL_EXT_subtexture',Buffer) > 0 then GL_EXT_subtexture:=True
  3182.                                          else GL_EXT_subtexture:=False;
  3183.   if Pos('GL_EXT_texture',Buffer) > 0 then GL_EXT_texture:=True
  3184.                                       else GL_EXT_texture:=False;
  3185.   if Pos('GL_EXT_texture_object',Buffer) > 0 then GL_EXT_texture_object:=True
  3186.                                              else GL_EXT_texture_object:=False;
  3187.   if Pos('GL_EXT_texture3D',Buffer) > 0 then GL_EXT_texture3D:=True
  3188.                                         else GL_EXT_texture3D:=False;
  3189.   if Pos('GL_EXT_cmyka',Buffer) > 0 then GL_EXT_cmyka:=True
  3190.                                     else GL_EXT_cmyka:=False;
  3191.   if Pos('GL_EXT_rescale_normal',Buffer) > 0 then GL_EXT_rescale_normal:=True
  3192.                                              else GL_EXT_rescale_normal:=False;
  3193.   if Pos('GL_SGI_color_matrix',Buffer) > 0 then GL_SGI_color_matrix:=True
  3194.                                            else GL_SGI_color_matrix:=False;
  3195.   if Pos('GL_SGI_texture_color_table',Buffer) > 0 then GL_SGI_texture_color_table:=True
  3196.                                                   else GL_SGI_texture_color_table:=False;
  3197.   if Pos('GL_SGI_color_table',Buffer) > 0 then GL_SGI_color_table:=True
  3198.                                           else GL_SGI_color_table:=False;
  3199.   if Pos('GL_EXT_clip_volume_hint',Buffer) > 0 then GL_EXT_clip_volume_hint:=True
  3200.                                                else GL_EXT_clip_volume_hint:=False;
  3201.   if Pos('GL_EXT_misc_attribute',Buffer) > 0 then GL_EXT_misc_attribute:=True
  3202.                                              else GL_EXT_misc_attribute:=False;
  3203.   if Pos('GL_EXT_scene_marker',Buffer) > 0 then GL_EXT_scene_marker:=True
  3204.                                            else GL_EXT_scene_marker:=False;
  3205.   if Pos('GL_EXT_shared_texture_palette',Buffer) > 0 then GL_EXT_shared_texture_palette:=True
  3206.                                                      else GL_EXT_shared_texture_palette:=False;
  3207.  
  3208.   // -- second GLU
  3209.   Buffer:=StrPas(PChar(gluGetString(GLU_EXTENSIONS)));
  3210.   if Pos('GLU_EXT_TEXTURE',Buffer) > 0 then GLU_EXT_TEXTURE:=True
  3211.                                        else GLU_EXT_TEXTURE:=False;
  3212.   if Pos('GLU_EXT_object_space_tess',Buffer) > 0 then GLU_EXT_object_space_tess:=True
  3213.                                                  else GLU_EXT_object_space_tess:=False;
  3214.   if Pos('GLU_EXT_nurbs_tessellator',Buffer) > 0 then GLU_EXT_nurbs_tessellator:=True
  3215.                                                  else GLU_EXT_nurbs_tessellator:=False;
  3216. end;
  3217.  
  3218. //------------------------------------------------------------------------------
  3219.  
  3220. procedure SetupPalette(DC: HDC; PFD: TPixelFormatDescriptor);
  3221.  
  3222. var nColors, I   : Integer;
  3223.     lpPalette    : PLogPalette;
  3224.     byRedMask,
  3225.     byGreenMask,
  3226.     byBlueMask   : Byte;
  3227.     Palette      : HPalette;
  3228.  
  3229. begin
  3230.   nColors:=1 shl Pfd.cColorBits;
  3231.   GetMem(lpPalette,SizeOf(TLogPalette)+(nColors*SizeOf(TPaletteEntry)));
  3232.   try
  3233.     lpPalette^.palVersion:=$300;
  3234.     lpPalette^.palNumEntries:=nColors;
  3235.     byRedMask  :=(1 shl Pfd.cRedBits)-1;
  3236.     byGreenMask:=(1 shl Pfd.cGreenBits)-1;
  3237.     byBlueMask :=(1 shl Pfd.cBlueBits)-1;
  3238.     {$ifopt R+} {$define RangeCheck} {$endif} {$R-}
  3239.     for I:=0 to nColors-1 do
  3240.     begin
  3241.       lpPalette^.palPalEntry[I].peRed  :=(((I shr Pfd.cRedShift)   and byRedMask)  *255) DIV byRedMask;
  3242.       lpPalette^.palPalEntry[I].peGreen:=(((I shr Pfd.cGreenShift) and byGreenMask)*255) DIV byGreenMask;
  3243.       lpPalette^.palPalEntry[I].peBlue :=(((I shr Pfd.cBlueShift)  and byBlueMask) *255) DIV byBlueMask;
  3244.       lpPalette^.palPalEntry[I].peFlags:=0;
  3245.     end;
  3246.     {$ifdef RangeCheck} {$R+} {$undef RangeCheck} {$endif}
  3247.     Palette:=CreatePalette(lpPalette^);
  3248.     if (Palette <> 0) then
  3249.     begin
  3250.       SelectPalette(DC,Palette,False);
  3251.       RealizePalette(DC);
  3252.     end;
  3253.   finally
  3254.     FreeMem(lpPalette);
  3255.   end;
  3256. end;
  3257.  
  3258. //------------------------------------------------------------------------------
  3259.  
  3260. function CreateRenderingContext(DC: HDC; Options: TRCOptions; ColorDepth: Integer; StencilBits: Byte): HGLRC;
  3261.  
  3262. // Set the OpenGL properties required to draw to the given canvas and
  3263. // create a rendering context for it.
  3264.  
  3265. var PFDescriptor : TPixelFormatDescriptor;
  3266.     PixelFormat  : Integer;
  3267.  
  3268. begin
  3269.   FillChar(PFDescriptor,SizeOf(PFDescriptor),0);
  3270.   with PFDescriptor do
  3271.   begin
  3272.     nSize:=sizeof(PFDescriptor);
  3273.     nVersion:=1;
  3274.     dwFlags:=PFD_SUPPORT_OPENGL;
  3275.     if GetObjectType(DC) = OBJ_MEMDC then dwFlags:=dwFlags or PFD_DRAW_TO_BITMAP
  3276.                                      else dwFlags:=dwFlags or PFD_DRAW_TO_WINDOW;
  3277.     if opDoubleBuffered in Options then dwFlags:=dwFlags or PFD_DOUBLEBUFFER;
  3278.     if opGDI in Options then dwFlags:=dwFlags or PFD_SUPPORT_GDI;
  3279.     if opStereo in Options then dwFlags:=dwFlags or PFD_STEREO;
  3280.     iPixelType:=PFD_TYPE_RGBA;
  3281.     cColorBits:=ColorDepth;
  3282.     cDepthBits:=32;
  3283.     cStencilBits:=StencilBits;
  3284.     iLayerType:=Byte(PFD_MAIN_PLANE);
  3285.   end;
  3286.  
  3287.   InitOpenGL; // just in case it didn't happen already
  3288.   PixelFormat:=ChoosePixelFormat(DC,@PFDescriptor);
  3289.   SetPixelFormat(DC,PixelFormat,@PFDescriptor);
  3290.   // check the properties just set
  3291.   DescribePixelFormat(DC,PixelFormat,SizeOf(PFDescriptor),@PFDescriptor);
  3292.   with PFDescriptor do
  3293.     if (dwFlags and PFD_NEED_PALETTE) <> 0 then SetupPalette(DC,PFDescriptor);
  3294.  
  3295.   Result:=wglCreateContext(DC);
  3296.  
  3297.   // read implementation properties
  3298.   if FirstContext and (Result > 0) then
  3299.   begin
  3300.     wglMakeCurrent(DC,Result);
  3301.     ReadImplementationProperties;
  3302.     FirstContext:=False;
  3303.     wglMakeCurrent(0,0);
  3304.   end;
  3305. end;
  3306.  
  3307. //------------------------------------------------------------------------------
  3308.  
  3309. procedure ActivateRenderingContext(DC: HDC; RC: HGLRC);
  3310.  
  3311. // read extension addresses
  3312.  
  3313. var PixelFormat : Integer;
  3314.  
  3315. begin
  3316.   // The extension function addresses are unique for each pixel format. All rendering
  3317.   // contexts of a given pixel format share the same extension function addresses.
  3318.   PixelFormat:=GetPixelFormat(DC);
  3319.   wglMakeCurrent(DC,RC);
  3320.   if PixelFormat <> LastPixelFormat then
  3321.   begin
  3322.     ClearExtensions;
  3323.     ReadExtensions;
  3324.     LastPixelFormat:=PixelFormat;
  3325.   end;
  3326. end;
  3327.  
  3328. //------------------------------------------------------------------------------
  3329.  
  3330. procedure DeactivateRenderingContext;
  3331.  
  3332. begin
  3333.   wglMakeCurrent(0,0);
  3334. end;
  3335.  
  3336. //------------------------------------------------------------------------------
  3337.  
  3338. procedure DestroyRenderingContext(RC: HGLRC);
  3339.  
  3340. begin
  3341.   if RC > 0 then wglDeleteContext(RC);
  3342. end;
  3343.  
  3344. //------------------------------------------------------------------------------
  3345.  
  3346. procedure CloseOpenGL;
  3347.  
  3348. begin
  3349.   if GLHandle > 0 then begin FreeLibrary(GLHandle); GLHandle:=0; end;
  3350.   if GLUHandle > 0 then begin FreeLibrary(GLUHandle); GLUHandle:=0; end;
  3351.   ClearProcAddresses;
  3352.   ClearExtensions;
  3353.   FirstContext:=True;
  3354. end;
  3355.  
  3356. //------------------------------------------------------------------------------
  3357.  
  3358. function InitOpenGL: Boolean;
  3359.  
  3360. begin
  3361.   if (GLHandle = 0) or (GLUHandle = 0) then
  3362.   begin
  3363.     Result:=InitOpenGLFromLibrary('OpenGL.DLL','GLU.DLL');
  3364.     if not Result then Result:=InitOpenGLFromLibrary('OpenGL32.DLL','GLU32.DLL');
  3365.   end
  3366.   else Result:=True;
  3367. end;
  3368.  
  3369. //------------------------------------------------------------------------------
  3370.  
  3371. function InitOpenGLFromLibrary(GL_Name, GLU_Name: String): Boolean;
  3372.  
  3373. var OldError: Longint;
  3374.  
  3375. begin
  3376.   Result:=False;
  3377.   CloseOpenGL;
  3378.   OldError:=SetErrorMode(SEM_NOOPENFILEERRORBOX);
  3379.   try
  3380.     GLHandle:=LoadLibrary(PChar(GL_Name));
  3381.     GLUHandle:=LoadLibrary(PChar(GLU_Name));
  3382.     if (GLHandle > 0) and (GLUHandle > 0) then
  3383.     begin
  3384.       LoadProcAddresses;
  3385.       Result:=True;
  3386.     end
  3387.     else
  3388.     begin
  3389.       if GLHandle > 0 then FreeLibrary(GLHandle);
  3390.       if GLUHandle > 0 then FreeLibrary(GLUHandle);
  3391.     end;
  3392.   finally
  3393.     SetErrorMode(OldError);
  3394.   end;
  3395. end;
  3396.  
  3397. //------------------------------------------------------------------------------
  3398.  
  3399. initialization
  3400. finalization
  3401.   CloseOpenGL;
  3402. end.
  3403.